You cannot get the error_description, because your object "error" does
not exist.
Take a look at the examples[1], it may give you an idea.
[1] -
https://github.com/keycloak/keycloak/blob/master/examples/js-console/src/...
On 2017-05-06, Mehdi Sheikhalishahi wrote:
Hi,
With the following code, I am not able to get error message. How should I
do that? thanks.
Uncaught TypeError: Cannot read property 'error_description' of undefined
at Object.errorCallback (index.js:49)
at Object.setError (keycloak.js:775)
at Object.errorCallback (keycloak.js:198)
at Object.setError (keycloak.js:775)
at XMLHttpRequest.req.onreadystatechange (keycloak.js:600)
return kc.init({onLoad: 'login-required'}).success(authenticated => {
console.log("AUTH STATUS: " + authenticated);
if(!authenticated) {
kc.login();
} else {
dispatch(loginSucceed(kc));
}}).error(function(error) {
console.log(error.error_description);
console.log(error.error);
console.log(JSON.stringify(error));
dispatch(loginFailed(JSON.stringify(error)));
});
_______________________________________________
keycloak-user mailing list
keycloak-user(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user
--
abstractj