Skip to content
Snippets Groups Projects
Commit 87660aad authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Set locale for Keycloak login page

parent 6ffde448
No related branches found
No related tags found
No related merge requests found
......@@ -106,11 +106,18 @@ class VPUAuth extends LitElement {
});
// See: https://www.keycloak.org/docs/latest/securing_apps/index.html#_javascript_adapter
that._keycloak.init({onLoad: 'login-required'}).success(function (authenticated) {
that._keycloak.init().success((authenticated) => {
console.log(authenticated ? 'authenticated' : 'not authenticated!');
console.log(that._keycloak);
this.loggedIn = false;
if (!authenticated) {
// set locale of Keycloak login page
that._keycloak.login({kcLocale: that.lang});
return;
}
that.loggedIn = false;
that.updateKeycloakData();
that.dispatchInitEvent();
......@@ -137,7 +144,7 @@ class VPUAuth extends LitElement {
}
}).error(function () {
console.log('Failed to initialize');
console.error('Keycloak failed to initialize!');
});
// auto-refresh token
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment