added the ability to link to email

This commit is contained in:
Jack 2021-09-06 14:26:14 +01:00
parent f15e0b931d
commit 295803df6b
2 changed files with 15 additions and 1 deletions

View file

@ -224,6 +224,19 @@ export function linkWithGoogle() {
});
}
export function linkWithEmail(email, password) {
var credential = firebase.auth.EmailAuthProvider.credential(email, password);
firebase
.auth()
.currentUser.linkWithCredential(credential)
.then(function (result) {
console.log(result);
})
.catch(function (error) {
console.log(error);
});
}
export function signOut() {
firebase
.auth()

View file

@ -9,7 +9,8 @@ global.getuid = Misc.getuid;
global.snapshot = DB.getSnapshot;
global.config = Config;
// global.addnotif = Notifications.add;
global.link = AccountController.linkWithGoogle;
global.linkToGoogle = AccountController.linkWithGoogle;
global.linkToEmail = AccountController.linkWithEmail;
global.filters = ResultFilters.getFilters();