Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!route.path.startsWith('/login') && !route.path.startsWith('/assets') && route.path !== '/') {
- store.state.requestUrl = route.path
- }
- if (!store.state.authenticated) {
- return redirect('/login')
- }
- await this.$store.dispatch('login', {
- username: this.loginDetails.username,
- password: this.loginDetails.password
- })
- this.$router.push(this.$store.state.requestUrl) // this is always '/'
- } catch (e) {
- console.log(e)
- this.failedLogin = true
- }
Add Comment
Please, Sign In to add comment