import {AuthMethods, AuthProviders, AngularFire, FirebaseAuthState} from "angularfire2";
import {AuthMethod} from "./auth-method";
import {Injectable} from "@angular/core";
@Injectable()
export class PasswordAuth implements AuthMethod{

  name: string = 'Password';

  constructor(private firebase: AngularFire){
  }

  login(email, password){
    return this.firebase.auth.login(
      {
        email: email,
        password: password
      },
      {
        provider: AuthProviders.Password,
        method: AuthMethods.Password
      }
    );
  }
}
