Skip to content

Commit

Permalink
change auth to id token
Browse files Browse the repository at this point in the history
  • Loading branch information
gugzkumar committed Nov 29, 2019
1 parent 64ecbed commit a522017
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions client-ui/src/app/core/interceptors/auth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export class AuthInterceptor implements HttpInterceptor {
}

intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const accessToken = this.authService.getCurrentAccessToken();
if (accessToken) {
const idToken = this.authService.getCurrentIdToken();
if (idToken) {
const clonedReq = req.clone({
headers: req.headers.set("Authorization", `Bearer ${accessToken}`)
headers: req.headers.set("Authorization", `Bearer ${idToken}`)
});
return next.handle(clonedReq);
}
Expand Down
4 changes: 2 additions & 2 deletions client-ui/src/app/core/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export class AuthService {
localStorage.removeItem(TOKEN);
}

getCurrentAccessToken() {
return localStorage.getItem(ACCESS_TOKEN);
getCurrentIdToken() {
return localStorage.getItem(ID_TOKEN);
}

handleAuthentication(authRouterParams) {
Expand Down

0 comments on commit a522017

Please sign in to comment.