Redirect to login form automatically in keycloak.js if login-required is set
This commit is contained in:
parent
08b1996149
commit
de36973716
1 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,10 @@ var Keycloak = function (config) {
|
|||
if (initOptions.checkLoginIframeInterval) {
|
||||
loginIframe.interval = initOptions.checkLoginIframeInterval;
|
||||
}
|
||||
|
||||
if (initOptions.onLoad === 'login-required') {
|
||||
kc.loginRequired = true;
|
||||
}
|
||||
}
|
||||
|
||||
var promise = createPromise();
|
||||
|
@ -374,6 +378,9 @@ var Keycloak = function (config) {
|
|||
if (kc.token) {
|
||||
setToken(null, null);
|
||||
kc.onAuthLogout && kc.onAuthLogout();
|
||||
if (kc.loginRequired) {
|
||||
kc.login();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue