Remove `require` from auth store
This commit is contained in:
parent
a7698ce56b
commit
341bcf5b17
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue