Last active
December 28, 2021 22:04
-
-
Save NyaGarcia/700e0eec5f1e76d41baff29874316949 to your computer and use it in GitHub Desktop.
Creating a login method in the auth service
This file contains hidden or 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
import { Auth, signInWithEmailAndPassword } from '@angular/fire/auth'; | |
import { Injectable } from '@angular/core'; | |
import { LoginData } from '../interfaces/login-data.interface'; | |
@Injectable({ | |
providedIn: 'root', | |
}) | |
export class AuthService { | |
constructor(private auth: Auth) {} | |
login({ email, password }: LoginData) { | |
return signInWithEmailAndPassword(this.auth, email, password); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment