File

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

Description

Anonymous firebase auth service

Constructor

constructor(afAuth: any)

Methods

login
login()

Login method

Returns: any

} promise with FirebaseAuthState

Properties

name
name: string
Default value: Anonymously

Name of auth method

import { AngularFireAuth } from "angularfire2/auth";
import {AuthMethod} from "./auth-method";
import {Injectable} from "@angular/core";

/**
 * Anonymous firebase auth service
 */
@Injectable()
export class AnonymouslyAuth implements AuthMethod{

  /**
   * Name of auth method
   */
  name: string = 'Anonymously';

  constructor(private afAuth: AngularFireAuth){
  }

  /**
   * Login method
   * @returns {firebase.Promise<FirebaseAuthState>} promise with FirebaseAuthState
   */
  login(): firebase.Promise<any>{
    return this.afAuth.auth.signInAnonymously();
  }
}

results matching ""

    No results matching ""