modules/firebase-connector/src/authMethods/password.ts
Password firebase auth (with email and password) service
constructor(afAuth: any)
|
login |
login(email: any, password: any)
|
Login method
Returns:
any
|
name |
name: |
Default value: Password
|
Name of auth method |
import { AngularFireAuth } from "angularfire2/auth";
import {AuthMethod} from "./auth-method";
import {Injectable} from "@angular/core";
/**
* Password firebase auth (with email and password) service
*/
@Injectable()
export class PasswordAuth implements AuthMethod{
/**
* Name of auth method
*/
name: string = 'Password';
constructor(private afAuth: AngularFireAuth){
}
/**
* Login method
* @return {firebase.Promise<FirebaseAuthState>} promise with FirebaseAuthState
*/
login(email, password): firebase.Promise<any>{
return this.afAuth.auth.signInWithEmailAndPassword(email, password);
}
}