Skip to content
Snippets Groups Projects
Commit 099bf0c3 authored by Marco De Donno's avatar Marco De Donno
Browse files

Simple quote to double quote

parent a73d358f
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
} );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment