Return textual error for permissions
This commit is contained in:
@@ -26,6 +26,10 @@ export class AuthInterceptor implements HttpInterceptor {
|
|||||||
catchError((error: HttpErrorResponse) => {
|
catchError((error: HttpErrorResponse) => {
|
||||||
if (error.status && error.status == 401) {
|
if (error.status && error.status == 401) {
|
||||||
this.auth.requestAuth();
|
this.auth.requestAuth();
|
||||||
|
return throwError(() => $localize`Authentication required`);
|
||||||
|
}
|
||||||
|
if (error.status && error.status == 403) {
|
||||||
|
return throwError(() => $localize`Permissions too low`);
|
||||||
}
|
}
|
||||||
return throwError(() => error);
|
return throwError(() => error);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user