KEYCLOAK-10910 login function now uses promise type specified in init
This commit is contained in:
parent
b1be6c2bdd
commit
97fccd6d50
1 changed files with 18 additions and 10 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue