KEYCLOAK-10910 login function now uses promise type specified in init

This commit is contained in:
jferrer 2019-07-23 11:28:40 +01:00 committed by Stan Silvert
parent b1be6c2bdd
commit 97fccd6d50

View file

@ -154,11 +154,19 @@
if (!prompt) {
options.prompt = 'none';
}
kc.login(options).success(function () {
initPromise.setSuccess();
}).error(function () {
initPromise.setError();
});
if (kc.useNativePromise) {
kc.login(options).then(function () {
initPromise.setSuccess();
}).catch(function () {
initPromise.setError();
});
} else {
kc.login(options).success(function () {
initPromise.setSuccess();
}).error(function () {
initPromise.setError();
});
}
}
var checkSsoSilently = function() {