aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-01-24 03:02:04 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-01-25 15:37:26 +0100
commitab398a05e9ffaacb8fc713bb2ba9717ac463b34c (patch)
treed73c6debfcc14c0dc05c681bb442e6f6fb6ce3a7 /client/src/app/core
parent6939cbac48e0a9823b34577836480ae3c28186be (diff)
downloadPeerTube-ab398a05e9ffaacb8fc713bb2ba9717ac463b34c.tar.gz
PeerTube-ab398a05e9ffaacb8fc713bb2ba9717ac463b34c.tar.zst
PeerTube-ab398a05e9ffaacb8fc713bb2ba9717ac463b34c.zip
redirect to login on 401, display error variants in 404 component
Diffstat (limited to 'client/src/app/core')
-rw-r--r--client/src/app/core/rest/rest-extractor.service.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/core/rest/rest-extractor.service.ts b/client/src/app/core/rest/rest-extractor.service.ts
index 84d9ed074..b8a95cca6 100644
--- a/client/src/app/core/rest/rest-extractor.service.ts
+++ b/client/src/app/core/rest/rest-extractor.service.ts
@@ -93,10 +93,10 @@ export class RestExtractor {
93 return observableThrowError(errorObj) 93 return observableThrowError(errorObj)
94 } 94 }
95 95
96 redirectTo404IfNotFound (obj: { status: number }, status = [ HttpStatusCode.NOT_FOUND_404 ]) { 96 redirectTo404IfNotFound (obj: { status: number }, type: 'video' | 'other', status = [ HttpStatusCode.NOT_FOUND_404 ]) {
97 if (obj && obj.status && status.indexOf(obj.status) !== -1) { 97 if (obj && obj.status && status.indexOf(obj.status) !== -1) {
98 // Do not use redirectService to avoid circular dependencies 98 // Do not use redirectService to avoid circular dependencies
99 this.router.navigate([ '/404' ], { skipLocationChange: true }) 99 this.router.navigate([ '/404' ], { state: { type, obj }, skipLocationChange: true })
100 } 100 }
101 101
102 return observableThrowError(obj) 102 return observableThrowError(obj)