Skip to content
Snippets Groups Projects
Commit bf2f9736 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

auth: fallback path in case the API is down

We still want to finish the auth process in that case, so the app
can display some error message.
parent 263bef3b
No related branches found
No related tags found
No related merge requests found
Pipeline #57950 passed
...@@ -83,7 +83,15 @@ export class AuthKeycloak extends AdapterLitElement { ...@@ -83,7 +83,15 @@ export class AuthKeycloak extends AdapterLitElement {
} }
async _fetchUser(userId) { async _fetchUser(userId) {
let jsonld = await JSONLD.getInstance(this.entryPointUrl, this.lang); let jsonld;
try {
jsonld = await JSONLD.getInstance(this.entryPointUrl, this.lang);
} catch(error) {
// Server is down, just give up.
return {
roles: [],
};
}
let baseUrl = ''; let baseUrl = '';
try { try {
baseUrl = jsonld.getApiUrlForEntityName("FrontendUser"); baseUrl = jsonld.getApiUrlForEntityName("FrontendUser");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment