diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2022-07-04 22:04:55 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-08 10:58:04 +0200 |
commit | 9469783d432d9d53eafe5ec0c0b4baa78af2510d (patch) | |
tree | 9c25ce85ed88b3ca0ae3373f66d36ec2cb6d24bc /client/src/app/shared | |
parent | a28b0f696c1990a3e7a7385e65d8ea910f46be1e (diff) | |
download | PeerTube-9469783d432d9d53eafe5ec0c0b4baa78af2510d.tar.gz PeerTube-9469783d432d9d53eafe5ec0c0b4baa78af2510d.tar.zst PeerTube-9469783d432d9d53eafe5ec0c0b4baa78af2510d.zip |
feat: custom msg upon 401 response
closes #4768
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared-main/auth/auth-interceptor.service.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts index 51248c7b2..7daf31a98 100644 --- a/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts +++ b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts | |||
@@ -61,8 +61,8 @@ export class AuthInterceptor implements HttpInterceptor { | |||
61 | return req.clone({ headers: req.headers.set('Authorization', authHeaderValue) }) | 61 | return req.clone({ headers: req.headers.set('Authorization', authHeaderValue) }) |
62 | } | 62 | } |
63 | 63 | ||
64 | private handleNotAuthenticated (err: HttpErrorResponse, path = '/login'): Observable<any> { | 64 | private handleNotAuthenticated (err: HttpErrorResponse): Observable<any> { |
65 | this.router.navigateByUrl(path) | 65 | this.router.navigate([ '/404' ], { state: { obj: err }, skipLocationChange: true }) |
66 | return of(err.message) | 66 | return of(err.message) |
67 | } | 67 | } |
68 | } | 68 | } |