File

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

Description

Facebook firebase auth service

Constructor

constructor(afAuth: any)

Methods

login
login()

Login method

Returns: any

Properties

name
name: string
Default value: Twitter

Name of auth method

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

import * as firebase from 'firebase/app';

/**
 * Facebook firebase auth service
 */
@Injectable()
export class TwitterAuth implements AuthMethod{

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

  constructor(private afAuth: AngularFireAuth){
  }

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

results matching ""

    No results matching ""