-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2121 from aura-nw/baseline/main_20230720
Baseline/main 20230720
- Loading branch information
Showing
261 changed files
with
7,952 additions
and
6,399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { | ||
HttpRequest, | ||
HttpHandler, | ||
HttpEvent, | ||
HttpInterceptor, | ||
} from '@angular/common/http'; | ||
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http'; | ||
import { Observable } from 'rxjs'; | ||
|
||
import { AuthenticationService } from '../services/auth.service'; | ||
|
||
@Injectable() | ||
export class JwtInterceptor implements HttpInterceptor { | ||
constructor( | ||
private authenticationService: AuthenticationService, | ||
) { } | ||
constructor(private authenticationService: AuthenticationService) {} | ||
|
||
intercept( | ||
request: HttpRequest<any>, | ||
next: HttpHandler | ||
): Observable<HttpEvent<any>> { | ||
const currentUser = this.authenticationService.currentUserValue; | ||
if (currentUser && currentUser.data && currentUser.data.access_token) { | ||
request = request.clone({ | ||
setHeaders: { | ||
Authorization: `Bearer ${currentUser.data.access_token}`, | ||
}, | ||
}); | ||
} | ||
return next.handle(request); | ||
} | ||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | ||
const currentUser = this.authenticationService.currentUserValue; | ||
request = request.clone({ | ||
setHeaders: { | ||
}, | ||
}); | ||
return next.handle(request); | ||
} | ||
} |
Oops, something went wrong.