Created
December 12, 2022 00:41
-
-
Save guidani/89348e6887097746cbdb03c12dc04edc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FirebaseAuth { | |
private firebase: firebase.app.App; | |
constructor(firebase: firebase.app.App) { | |
this.firebase = firebase; | |
} | |
public login(email: string, password: string): Promise<firebase.auth.UserCredential> { | |
return this.firebase.auth().signInWithEmailAndPassword(email, password); | |
} | |
public logout(): Promise<void> { | |
return this.firebase.auth().signOut(); | |
} | |
public createUser(email: string, password: string): Promise<firebase.auth.UserCredential> { | |
return this.firebase.auth().createUserWithEmailAndPassword(email, password); | |
} | |
public resetPassword(email: string): Promise<void> { | |
return this.firebase.auth().sendPasswordResetEmail(email); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment