Return textual error for permissions

This commit is contained in:
2023-03-11 18:13:47 +01:00
parent 1d3918db87
commit 2cb5af904e

View File

@@ -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);
}) })