Skip to content

Commit

Permalink
Adding Facebook Auth
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeSchlangen committed Dec 17, 2016
1 parent 1665a9f commit 1818185
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/auth/components/sign-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { AuthService } from '../services/auth-service';
<button class="sign-in__button" (click)="signInWithGithub()" type="button">GitHub</button>
<button class="sign-in__button" (click)="signInWithGoogle()" type="button">Google</button>
<button class="sign-in__button" (click)="signInWithTwitter()" type="button">Twitter</button>
<button class="sign-in__button" (click)="signInWithFacebook()" type="button">Facebook</button>
</div>
</div>
`
Expand Down Expand Up @@ -43,6 +44,11 @@ export class SignInComponent {
.then(() => this.postSignIn());
}

signInWithFacebook(): void {
this.auth.signInWithFacebook()
.then(() => this.postSignIn());
}

private postSignIn(): void {
this.router.navigate(['/tasks']);
}
Expand Down
4 changes: 4 additions & 0 deletions src/auth/services/auth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export class AuthService {
return this.signIn(AuthProviders.Twitter);
}

signInWithFacebook(): firebase.Promise<FirebaseAuthState> {
return this.signIn(AuthProviders.Facebook);
}

signOut(): void {
this.auth$.logout();
}
Expand Down

0 comments on commit 1818185

Please sign in to comment.