Skip to content

Commit 1076c00

Browse files
added a new auth store
1 parent 2e453e5 commit 1076c00

File tree

5 files changed

+33
-1
lines changed

5 files changed

+33
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export default {
2+
login() {},
3+
async signup(context, payload) {
4+
const response = await fetch('', {
5+
method: 'POST',
6+
body: JSON.stringify({
7+
email: payload.email,
8+
password: payload.password,
9+
returnSecureToken: true
10+
})
11+
});
12+
13+
}
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import mutations from './mutations.js';
2+
import actions from './actions.js';
3+
import getters from './getters.js';
4+
5+
export default {
6+
state() {
7+
return {
8+
auth: {}
9+
}
10+
},
11+
mutations,
12+
actions,
13+
getters
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {}

JavaScriptWorld/src/store/store.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { createStore } from 'vuex';
22
import users from './users/index.js';
33
import articles from './articles/index.js';
4+
import auth from './auth/index.js';
45

56
const store = createStore({
67
modules: {
78
users,
8-
articles
9+
articles,
10+
auth
911
}
1012
})
1113

0 commit comments

Comments
 (0)