mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 21:31:07 +03:30
Edit number 2
This commit is contained in:
+4
-4
@@ -1,13 +1,13 @@
|
||||
import { UserService, AuthenticationError } from '@/services/auth/user.service'
|
||||
import router from '@/router'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
async login({ commit }, {cell_number, password}) {
|
||||
commit('loginRequest');
|
||||
|
||||
try {
|
||||
const token = await UserService.login(cell_number, password);
|
||||
commit('loginSuccess', token)
|
||||
commit('loginSuccess', token);
|
||||
|
||||
// Redirect the user to the page he first tried to visit or to the home view
|
||||
router.push(router.history.current.query.redirect || '/');
|
||||
@@ -32,8 +32,8 @@ export default {
|
||||
// TODO: Open Modal For Get Section
|
||||
},
|
||||
|
||||
logout({ commit }) {
|
||||
UserService.logout()
|
||||
async logout({ commit }) {
|
||||
const result = await UserService.logout();
|
||||
commit('logoutSuccess')
|
||||
router.push('/login')
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user