Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICNML
web app
Commits
099bf0c3
Commit
099bf0c3
authored
5 years ago
by
Marco De Donno
Browse files
Options
Downloads
Patches
Plain Diff
Simple quote to double quote
parent
a73d358f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/login.html
+49
-49
49 additions, 49 deletions
templates/login.html
with
49 additions
and
49 deletions
templates/login.html
+
49
−
49
View file @
099bf0c3
...
...
@@ -55,12 +55,12 @@
<script
type=
"text/javascript"
>
var
login_action_password
=
async
function
()
{
$
(
'
#icnml_login_error
'
).
html
(
''
);
$
(
'
#login_button > span
'
).
text
(
"
Please wait...
"
);
$
(
"
#icnml_login_error
"
).
html
(
""
);
$
(
"
#login_button > span
"
).
text
(
"
Please wait...
"
);
var
username
=
$
(
'
#username
'
).
val
();
var
password
=
$
(
'
#password
'
).
val
();
var
password_local
=
$
(
'
#password
'
).
val
();
var
username
=
$
(
"
#username
"
).
val
();
var
password
=
$
(
"
#password
"
).
val
();
var
password_local
=
$
(
"
#password
"
).
val
();
password
=
await
generateKey
(
password
,
"
icnml_
"
+
username
,
20000
);
password
=
password
.
substring
(
0
,
128
);
...
...
@@ -73,9 +73,9 @@
sessionStorage
.
setItem
(
"
session_key
"
,
e
);
$
.
ajax
(
{
url
:
'
{{ url_for(
'
do_login
'
) }}
'
,
dataType
:
'
json
'
,
method
:
'
POST
'
,
url
:
"
{{ url_for( 'do_login' ) }}
"
,
dataType
:
"
json
"
,
method
:
"
POST
"
,
data
:
{
username
:
username
,
password
:
password
...
...
@@ -88,22 +88,22 @@
{
location
.
href
=
"
{{ url_for( 'home' ) }}
"
;
}
else
if
(
data
.
next_step
===
'
totp
'
)
{
}
else
if
(
data
.
next_step
===
"
totp
"
)
{
build_totp_form
();
}
else
if
(
data
.
next_step
===
'
securitykey
'
)
{
}
else
if
(
data
.
next_step
===
"
securitykey
"
)
{
build_securitykey_form
();
}
else
{
if
(
typeof
data
.
message
!==
'
undefined
'
)
if
(
typeof
data
.
message
!==
"
undefined
"
)
var
message
=
data
.
message
;
else
var
message
=
'
Invalid username/password
'
;
var
message
=
"
Invalid username/password
"
;
$
(
'
#icnml_login_error
'
).
text
(
message
);
$
(
"
#icnml_login_error
"
).
text
(
message
);
}
$
(
'
#login_button > span
'
).
text
(
"
Login
"
);
$
(
"
#login_button > span
"
).
text
(
"
Login
"
);
}
}
}
);
...
...
@@ -111,15 +111,15 @@
var
login_action_totp
=
function
()
{
$
(
'
#icnml_login_error
'
).
html
(
''
);
$
(
'
#login_button > span
'
).
text
(
"
Please wait...
"
);
$
(
"
#icnml_login_error
"
).
html
(
""
);
$
(
"
#login_button > span
"
).
text
(
"
Please wait...
"
);
$
.
ajax
(
{
url
:
'
{{ url_for(
'
do_login
'
) }}
'
,
dataType
:
'
json
'
,
method
:
'
POST
'
,
url
:
"
{{ url_for( 'do_login' ) }}
"
,
dataType
:
"
json
"
,
method
:
"
POST
"
,
data
:
{
totp
:
$
(
'
#totp
'
).
val
()
totp
:
$
(
"
#totp
"
).
val
()
},
success
:
function
(
data
)
{
...
...
@@ -129,12 +129,12 @@
{
location
.
href
=
"
{{ url_for( 'home' ) }}
"
;
}
else
if
(
data
.
next_step
===
'
securitykey
'
)
{
}
else
if
(
data
.
next_step
===
"
securitykey
"
)
{
build_securitykey_form
();
}
else
{
if
(
typeof
data
.
message
!==
'
undefined
'
)
$
(
'
#icnml_login_error
'
).
text
(
data
.
message
);
if
(
typeof
data
.
message
!==
"
undefined
"
)
$
(
"
#icnml_login_error
"
).
text
(
data
.
message
);
}
}
}
...
...
@@ -143,21 +143,21 @@
var
build_totp_form
=
function
()
{
$
(
'
#icnml_login_error
'
).
html
(
''
);
$
(
'
#icnml_box_fields
'
).
html
(
''
);
$
(
'
#icnml_box_fields
'
)
$
(
"
#icnml_login_error
"
).
html
(
""
);
$
(
"
#icnml_box_fields
"
).
html
(
""
);
$
(
"
#icnml_box_fields
"
)
.
append
(
$
(
'
<div />
'
)
$
(
"
<div />
"
)
.
text
(
"
TOTP
"
)
.
css
(
"
text-align
"
,
"
right
"
)
)
.
append
(
$
(
'
<div />
'
).
append
(
$
(
'
<input />
'
)
$
(
"
<div />
"
).
append
(
$
(
"
<input />
"
)
.
attr
(
"
id
"
,
"
totp
"
)
.
attr
(
"
name
"
,
"
totp
"
)
.
css
(
"
width
"
,
"
100%
"
)
.
on
(
'
keyup
'
,
function
(
event
)
.
on
(
"
keyup
"
,
function
(
event
)
{
if
(
event
.
keyCode
==
13
)
{
...
...
@@ -168,25 +168,25 @@
)
);
$
(
'
#totp
'
).
focus
();
$
(
"
#totp
"
).
focus
();
}
var
build_securitykey_form
=
function
()
{
$
(
'
#icnml_login_error
'
).
html
(
''
);
$
(
'
#icnml_box_fields
'
).
html
(
''
);
$
(
"
#icnml_login_error
"
).
html
(
""
);
$
(
"
#icnml_box_fields
"
).
html
(
""
);
$
(
'
#icnml_box_fields
'
)
.
removeClass
(
'
icnml_box_fields
'
)
.
addClass
(
'
icnml_auto
'
);
$
(
"
#icnml_box_fields
"
)
.
removeClass
(
"
icnml_box_fields
"
)
.
addClass
(
"
icnml_auto
"
);
$
(
'
#login_button
'
).
remove
();
$
(
'
#password_reset
'
).
remove
();
$
(
"
#login_button
"
).
remove
();
$
(
"
#password_reset
"
).
remove
();
$
(
'
#icnml_homepage_form
'
)
$
(
"
#icnml_homepage_form
"
)
.
prepend
(
$
(
'
<div />
'
)
.
css
(
'
margin-bottom
'
,
'
10px
'
)
$
(
"
<div />
"
)
.
css
(
"
margin-bottom
"
,
"
10px
"
)
.
text
(
"
Logging with your security key...
"
)
);
...
...
@@ -194,7 +194,7 @@
}
/* Events binding */
$
(
'
#username
'
).
on
(
'
keyup
'
,
function
(
event
)
$
(
"
#username
"
).
on
(
"
keyup
"
,
function
(
event
)
{
if
(
event
.
keyCode
==
13
)
{
...
...
@@ -202,7 +202,7 @@
login_action_password
();
}
}
);
$
(
'
#password
'
).
on
(
'
keyup
'
,
function
(
event
)
$
(
"
#password
"
).
on
(
"
keyup
"
,
function
(
event
)
{
if
(
event
.
keyCode
==
13
)
{
...
...
@@ -211,20 +211,20 @@
}
}
);
$
(
'
#login_button
'
).
on
(
'
click
'
,
login_action_password
);
$
(
"
#login_button
"
).
on
(
"
click
"
,
login_action_password
);
$
(
'
#username
'
).
focus
();
$
(
"
#username
"
).
focus
();
$
(
document
).
ready
(
function
()
{
if
(
!
window
.
crypto
||
!
window
.
crypto
.
subtle
||
!
window
.
TextEncoder
||
!
window
.
TextDecoder
)
{
$
(
'
#warning
'
)
$
(
"
#warning
"
)
.
text
(
"
Your browser does not support client-side cryptography. Please use compatible browser (Firefox, Chrome, Opera, Safari, ...) to protect your password before sending it to the ICNML server.
"
);
$
(
'
#username
'
).
prop
(
"
disabled
"
,
true
);
$
(
'
#password
'
).
prop
(
"
disabled
"
,
true
);
$
(
'
#login_button
'
).
remove
();
$
(
"
#username
"
).
prop
(
"
disabled
"
,
true
);
$
(
"
#password
"
).
prop
(
"
disabled
"
,
true
);
$
(
"
#login_button
"
).
remove
();
}
}
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment