how can I solve this problem? help me please keycloak.init({ onLoad: 'login-required' }).success(function () {}
TypeError: keycloak.init is not a function
Instead of :
const keycloak = Keycloak('./public/keycloak.json');
Try this:
const keycloak = Keycloak('/keycloak.json');
and set promiseType to native in the init options like this(in your case) :
keycloak.init({onLoad: 'login-required', promiseType: 'native'}).then(authenticated => {
this.setState({ keycloak: keycloak, authenticated: authenticated })
})
Share E
instead of :
const keycloak = Keycloak('./public/keycloak.json');
Try this:
const keycloak = Keycloak('/keycloak.json');
and set promiseType to native in the init options like this(in your case) :
keycloak.init({onLoad: 'login-required', promiseType: 'native'})
.then(authenticated => { this.setState({ keycloak: keycloak, authenticated: authenticated }) })
it is a good answer thank you very much