Fix usage of router

This commit is contained in:
Georg Krause 2022-03-01 12:50:33 +01:00
parent 8127bc10ba
commit 4e797dbb71
No known key found for this signature in database
GPG Key ID: FD479B9A4D48E632
1 changed files with 1 additions and 2 deletions

View File

@ -132,7 +132,6 @@ export default {
actions: { actions: {
// Send a request to the login URL and save the returned JWT // Send a request to the login URL and save the returned JWT
login ({ commit, dispatch }, { next, credentials, onError }) { login ({ commit, dispatch }, { next, credentials, onError }) {
const router = require('@/router').default
const form = new FormData() const form = new FormData()
Object.keys(credentials).forEach((k) => { Object.keys(credentials).forEach((k) => {
form.set(k, credentials[k]) form.set(k, credentials[k])
@ -142,7 +141,7 @@ export default {
// commit('token', response.data.token) // commit('token', response.data.token)
dispatch('fetchProfile').then(() => { dispatch('fetchProfile').then(() => {
// Redirect to a specified route // Redirect to a specified route
router.push(next) this.$router.push(next)
}) })
}, response => { }, response => {
logger.default.error('Error while logging in', response.data) logger.default.error('Error while logging in', response.data)