Remove `require` from auth store

This commit is contained in:
Kasper Seweryn 2022-03-08 14:04:54 +00:00 committed by Georg Krause
parent a7698ce56b
commit 341bcf5b17
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) return this.$router.push(next)
}) })
}, response => { }, response => {
logger.default.error('Error while logging in', response.data) logger.default.error('Error while logging in', response.data)