How to use the angularfire2.AuthProviders.Twitter function in angularfire2

To help you get started, we’ve selected a few angularfire2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cjsheets / angular-voting-app / src / app / navbar / auth.service.ts View on Github external
getAuthProvider(provider: string): {} {
    var authProvider = {method: AuthMethods.Redirect};
    switch (provider){
      case 'Google': authProvider['provider'] = AuthProviders.Google; break;
      case 'Github': authProvider['provider'] = AuthProviders.Github; break;
      case 'Facebook': authProvider['provider'] = AuthProviders.Facebook; break;
      case 'Twitter': authProvider['provider'] = AuthProviders.Twitter; break;
      default: return '{}';
    }
    return authProvider;
  }
github aviabird / pinterest / src / app / services / authentication.ts View on Github external
private _getProvider(from: string) {
    switch(from){
      case 'twitter': return AuthProviders.Twitter;
      case 'facebook': return AuthProviders.Facebook;
      case 'github': return AuthProviders.Github;
      case 'google': return AuthProviders.Google;
    }
  }
}
github aviabird / angularhunt / src / app / services / authentication.service.ts View on Github external
private _getProvider(from: string) {
    switch (from) {
      case 'twitter': return AuthProviders.Twitter;
      case 'facebook': return AuthProviders.Facebook;
      case 'github': return AuthProviders.Github;
      case 'google': return AuthProviders.Google;
    }
  }
}
github anihalaney / rwa-trivia / src / app / core / components / login / login.component.spec.ts View on Github external
let deButtons = fixture.debugElement.queryAll(By.css('button'));

    deButtons[0].triggerEventHandler('click', null);
    expect(af.auth.login).toHaveBeenCalled();
    expect(spy.calls.mostRecent().args[0].provider).toBe(AuthProviders.Google, 'Provider Google');
    expect(spy.calls.mostRecent().args[0].method).toBe(AuthMethods.Popup, 'Method Popup');

    deButtons[1].triggerEventHandler('click', null);
    expect(af.auth.login).toHaveBeenCalled();
    expect(spy.calls.mostRecent().args[0].provider).toBe(AuthProviders.Facebook, 'Provider Facebook');
    expect(spy.calls.mostRecent().args[0].method).toBe(AuthMethods.Popup, 'Method Popup');

    deButtons[2].triggerEventHandler('click', null);
    expect(af.auth.login).toHaveBeenCalled();
    expect(spy.calls.mostRecent().args[0].provider).toBe(AuthProviders.Twitter, 'Provider Twitter');
    expect(spy.calls.mostRecent().args[0].method).toBe(AuthMethods.Popup, 'Method Popup');

    deButtons[3].triggerEventHandler('click', null);
    expect(af.auth.login).toHaveBeenCalled();
    expect(spy.calls.mostRecent().args[0].provider).toBe(AuthProviders.Github, 'Provider Github');
    expect(spy.calls.mostRecent().args[0].method).toBe(AuthMethods.Popup, 'Method Popup');

    let spy2 = spyOn(dialog, "open")
            .and.callFake((type: any, options: any) => {
              expect(typeof type).toEqual("function");
              expect(options.disableClose).toEqual(false);
            });

    deButtons[4].triggerEventHandler('click', null);
    expect(spy2).toHaveBeenCalled();