Skip to content

Commit 9a536ff

Browse files
committed
Base login
1 parent 7f6160a commit 9a536ff

File tree

4 files changed

+17
-38
lines changed

4 files changed

+17
-38
lines changed

src/_modules/account.module.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ const actions = {
4545
dispatch('alert/error', error, {root: true});
4646
}
4747
);
48-
},
49-
// async getUserSession({commit}) {
50-
// // const user = await userService.getUserSession();
51-
// // console.log(user);
52-
// // commit('loginSuccess', user);
53-
// // return user;
54-
// }
48+
}
5549
};
5650

5751
const mutations = {

src/_services/user.service.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,18 @@ export const userService = {
77
};
88

99
function login(email, password) {
10-
return requestService.post('/oauth/login', {email: email, password: password});
10+
// return requestService.post('/oauth/login', {email: email, password: password})
11+
12+
//PUT HERE API CALL
13+
return new Promise((resolve) => {
14+
resolve({
15+
'success': true,
16+
'data': {
17+
'email': email,
18+
'access_token': password
19+
}
20+
});
21+
})
1122
}
1223

1324
function getUserSession() {

src/router/index.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/views/Auth/Login.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
},
2222
created() {
2323
this.returnUrl = this.$route.query.returnUrl || '/';
24+
if (Object.keys(this.$store.state.account.user).length) {
25+
this.$router.push({name: 'home'});
26+
}
2427
},
2528
methods: {
2629
handleSubmit() {
@@ -41,4 +44,4 @@
4144
}
4245
}
4346
};
44-
</script>
47+
</script>

0 commit comments

Comments
 (0)