From 409a6cf6a7dfe13647b2d3760a4d308885773a28 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Mon, 1 Oct 2018 17:11:01 -0500 Subject: [PATCH] new endpoints package to mimic what has been done in other api projects --- .../v1/login-ui/src/app/auth/auth.service.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/login/frontend/v1/login-ui/src/app/auth/auth.service.ts b/login/frontend/v1/login-ui/src/app/auth/auth.service.ts index 1ae37382..61170251 100644 --- a/login/frontend/v1/login-ui/src/app/auth/auth.service.ts +++ b/login/frontend/v1/login-ui/src/app/auth/auth.service.ts @@ -11,8 +11,10 @@ export class AuthResponse { @Injectable() export class AuthService { - private antisocialAuthUrl = '/api/auth/antisocial'; - private facebookAuthUrl = '/api/auth/facebook'; + private antisocialAuthUrl = '/api/antisocial'; + private facebookAuthUrl = '/api/social/facebook'; + private githubAuthUrl = '/api/social/github'; + private googleAuthUrl = '/api/social/google'; constructor(private http: HttpClient) { } @@ -25,8 +27,15 @@ export class AuthService { return this.http.get(this.antisocialAuthUrl, {headers: httpHeaders}) } - authorizeFacebook(userData: any) { - const httpHeaders = new HttpHeaders({'token': userData.token}); - return this.http.get(this.facebookAuthUrl, {headers: httpHeaders}) + authenticateWithFacebook() { + return this.http.get(this.facebookAuthUrl) + } + + authenticateWithGithub() { + return this.http.get(this.githubAuthUrl) + } + + authenticateWithGoogle() { + return this.http.get(this.googleAuthUrl) } }