mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-17 19:15:59 +08:00
added the ability to link to email
This commit is contained in:
parent
f15e0b931d
commit
295803df6b
2 changed files with 15 additions and 1 deletions
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue