$('#navbar').parent().html(`
`)
var signout = function() {
firebase.auth()
.signOut()
.then(function() {
document.location.href = '/it1/'
}).catch(function(error) {
alert('could not log out: '+error.message)
})
}
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
$('#login-btn').attr('href', 'javascript: signout()')
$('#login-btn').html('Logout')
} else {
$('#login-btn').attr('href', '/it1/bruker/')
$('#login-btn').html('Login')
}
})
for (var i = 0; i < $('#navbar').children().length; i++) {
$('#navbar').children().css('color', 'springgreen')
}