new endpoints package to mimic what has been done in other api projects

pull/6/head
Chris Veilleux 2018-10-01 17:11:01 -05:00
parent c669ec49d8
commit 409a6cf6a7
1 changed files with 14 additions and 5 deletions

View File

@ -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<AuthResponse>(this.antisocialAuthUrl, {headers: httpHeaders})
}
authorizeFacebook(userData: any) {
const httpHeaders = new HttpHeaders({'token': userData.token});
return this.http.get<AuthResponse>(this.facebookAuthUrl, {headers: httpHeaders})
authenticateWithFacebook() {
return this.http.get<any>(this.facebookAuthUrl)
}
authenticateWithGithub() {
return this.http.get<any>(this.githubAuthUrl)
}
authenticateWithGoogle() {
return this.http.get<any>(this.googleAuthUrl)
}
}