Skip to content

Instantly share code, notes, and snippets.

@PatrickKalkman
Created January 15, 2022 14:29
Show Gist options
  • Select an option

  • Save PatrickKalkman/ec22c39ade30496ea0e709caf5d5ada5 to your computer and use it in GitHub Desktop.

Select an option

Save PatrickKalkman/ec22c39ade30496ea0e709caf5d5ada5 to your computer and use it in GitHub Desktop.
The validateToken method of the LoginUser.vue component
validateToken() {
this.$store
.dispatch('validateToken', {
token: this.token,
})
.then(() => {
if (this.$store.state.twofactorvalidated) {
this.$router.push({ name: 'dashboard' });
} else {
this.error = 'The provided token was not valid, please try again';
}
})
.catch((err) => {
this.error = err.response.data.message;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment