-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger updateToken #57
Comments
I'm not sure if this will help you, but what about intercepting http requests and inspecting the status code? axios.interceptors.response.use(response => {
return response
}, error => {
if (error.response.status === 403) {
// Do something
} else {
return Promise.reject(error)
}
}) |
Yes that's exactly what I wanted to do as well, my actual question was, where you got |
If updateToken() from the Keycloak JS adapter is the only thing that'll help, I guess this function also has to be exposed. I'm wondering if it's better to just expose the whole Keycloak object altogether, acting like a proxy, so every function/property is exposed always.... |
I agree, there could be many use cases, where I see the updateToken being manually triggered. For example, I would like to updateToken on window.onfocus()... The plugin will be totally flexible! |
@CryptoZorro this should now be possible with version 1.3.1+ by doing Vue.$keycloak.keycloak.updateToken(60) |
Thanks for this helpful plugin.
I understand that there is an implicit token refresh, but I would like to trigger
updateToken()
before making an API call (or) as a part of error handling of an 403 response, like how it's mentioned in the JS adapter docs. How do I do this?I did try $keycloak.updateToken but this function is not exposed with the $keycloak instance. Is there any other way? Thanks in advance!
The text was updated successfully, but these errors were encountered: