Skip to content

Instantly share code, notes, and snippets.

@ronronan
Created October 10, 2019 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronronan/1462415a6a06cabf34b7c3dd7e3f6265 to your computer and use it in GitHub Desktop.
Save ronronan/1462415a6a06cabf34b7c3dd7e3f6265 to your computer and use it in GitHub Desktop.
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