Created
October 10, 2019 13:49
-
-
Save ronronan/1462415a6a06cabf34b7c3dd7e3f6265 to your computer and use it in GitHub Desktop.
vue-spring-keycloak-front - check auth vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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