This commit is contained in:
Jacob Levine 2019-02-09 14:32:52 -06:00
parent f8dafe61f8
commit 1073bc458a

View File

@ -77,18 +77,19 @@ function updun() {
function updem() { function updem() {
var user = firebase.auth().currentUser; var user = firebase.auth().currentUser;
user.updateEmail("user@example.com").then(function() { user.updateEmail("user@example.com").then(function() {
document.getElementById('newDN').value = firebase.auth().currentUser.email; document.getElementById('newDN').value = firebase.auth().currentUser.email;
if (user.displayName != null) { if (user.displayName != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName; document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName;
document.getElementById('newDN').value = user.displayName; document.getElementById('newDN').value = user.displayName;
} else if (user.email != null) { } else if (user.email != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.email; document.getElementById('status').innerHTML = "You are signed in as: " + user.email;
}).catch(function(error) { }
if (error.code == 'auth/requires-recent-login') { }).catch(function(error) {
alert("Please sign in again to delete your account.") if (error.code == 'auth/requires-recent-login') {
window.location.href = '../'; alert("Please sign in again to delete your account.")
} else { window.location.href = '../';
alert("there was a problem: " + error) } else {
} alert("there was a problem: " + error)
}); }
} });
}