[keycloak-user] JavaScript adapter: how to get error message

Mehdi Sheikhalishahi mehdi.alishahi at gmail.com
Sat May 6 12:24:13 EDT 2017


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)));
});


More information about the keycloak-user mailing list