Skip to content

Instantly share code, notes, and snippets.

@ronronan
Created Oct 10, 2019
Embed
What would you like to do?
vue-spring-keycloak-front - check auth vue
if (Vue.prototype.$keycloak.token !== null) {
this.authenticated = true;
this.user.username = Vue.prototype.$keycloak.userName;
this.user.role = Vue.prototype.$keycloak.tokenParsed.realm_access.roles[0];
this.user.email = Vue.prototype.$keycloak.tokenParsed.email;
} else {
console.log('Not logged');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment