write-ups-challenges-2020-2021/break_the_gate/script/2.js
2022-11-24 18:03:20 +01:00

19 lines
380 B
JavaScript

function authenticate() {
if (userDb[$('#inp_user').val()] == $('#inp_passw').val()) {
sendAuth({thisUser: userDb[$('#inp_user').val()]}, goNext, errorAnimation);
} else {
errorAnimation();
}
}
$(document).ready(function(){
$('#submit').click(function(){
authenticate();
})
$(document).on('keypress',function(e) {
if(e.which == 13) {
authenticate();
}
});
})