Created
January 15, 2022 14:29
-
-
Save PatrickKalkman/ec22c39ade30496ea0e709caf5d5ada5 to your computer and use it in GitHub Desktop.
The validateToken method of the LoginUser.vue component
This file contains hidden or 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
| 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