modules/firebase-connector/src/authMethods/anonymously.ts
Anonymous firebase auth service
constructor(afAuth: any)
|
login |
login()
|
Login method
Returns:
any
|
name |
name: |
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();
}
}