Skip to content

Instantly share code, notes, and snippets.

@guidani
Created December 12, 2022 00:41
Show Gist options
  • Save guidani/89348e6887097746cbdb03c12dc04edc to your computer and use it in GitHub Desktop.
Save guidani/89348e6887097746cbdb03c12dc04edc to your computer and use it in GitHub Desktop.
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