mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge branch 'DSpace:main' into main
This commit is contained in:
@@ -196,7 +196,24 @@ export class AuthInterceptor implements HttpInterceptor {
|
|||||||
authStatus.token = new AuthTokenInfo(accessToken);
|
authStatus.token = new AuthTokenInfo(accessToken);
|
||||||
} else {
|
} else {
|
||||||
authStatus.authenticated = false;
|
authStatus.authenticated = false;
|
||||||
authStatus.error = isNotEmpty(error) ? ((typeof error === 'string') ? JSON.parse(error) : error) : null;
|
if (isNotEmpty(error)) {
|
||||||
|
if (typeof error === 'string') {
|
||||||
|
try {
|
||||||
|
authStatus.error = JSON.parse(error);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Unknown auth error "', error, '" caused ', e);
|
||||||
|
authStatus.error = {
|
||||||
|
error: 'Unknown',
|
||||||
|
message: 'Unknown auth error',
|
||||||
|
status: 500,
|
||||||
|
timestamp: Date.now(),
|
||||||
|
path: ''
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
authStatus.error = error;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return authStatus;
|
return authStatus;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user