basic authentication

This commit is contained in:
sava
2020-03-27 22:24:01 +01:00
parent 8676f94dcc
commit 891f219379
13 changed files with 197 additions and 87 deletions

18
it1/js/auth.js Normal file
View File

@@ -0,0 +1,18 @@
var signin = function() {
firebase.auth()
.signInWithEmailAndPassword($('#mail')[0].value, $('#password')[0].value)
.then(function() {
document.location.href = "/it1/"
}).catch(function(error) {
$('#status').html('<h3>Kunne ikke logge inn som '+$('#mail')[0].value+'!</h3><p>'+error.code+': '+error.message+'</p>')
$('#status').css('color', 'red')
})
}
$(document).keydown(function(e) {
if (e.which == 13){
$("#login").click()
}
})