File

modules/firebase-connector/src/authMethods/password.ts

Description

Password firebase auth (with email and password) service

Constructor

constructor(afAuth: any)

Methods

login
login(email: any, password: any)

Login method

Returns: any

Properties

name
name: string
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);
  }
}

results matching ""

    No results matching ""