Skip to content

Commit efb3134

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents 1b114c5 + 5f7be98 commit efb3134

4 files changed

Lines changed: 26 additions & 13 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,15 @@ as you like in this plugins. The most important choices are:
4949
- Do you want to use authorisation?
5050
- This creates a login, password forgotten and invitation page
5151
- You'll get follow up questions about the Oauth settings from the API
52+
53+
### Development
54+
To test/develop the kingscode scaffold you can locally invoke this plugin.
55+
create a test project (`vue create scaffold-tester`) just like above.
56+
57+
install the cli-plugin locally
58+
59+
`npm install path\to\local\vue-cli-plugin-kingscode-scaffold`
60+
61+
invoke the plugin
62+
63+
`vue invoke kingscode-scaffold`

generator/templates/Authorisation/src/views/authorisation/AuthorisationCallback.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default {
1515
setAuthorisationToken: 'authorisation/setAuthorisationToken',
1616
}),
1717
},
18-
async created() {
18+
created() {
1919
const redirectUri = this.$route.query.redirect_uri;
2020
2121
const token = getFragment('token');
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
import router from '../../router';
22

3+
const initialState = ({ token: null });
4+
35
export default {
46
namespaced: true,
5-
state: {
6-
token: '',
7-
},
7+
state: initialState,
88
mutations: {
99
setAuthorisationToken(state, token) {
10-
state.token = token;
10+
Object.assign(state, { token });
11+
},
12+
resetAuthorisation(state) {
13+
Object.keys(state).forEach((key) => delete state[key]);
14+
Object.assign(state, initialState);
1115
},
1216
},
1317
actions: {
14-
logout(context) {
15-
context.commit('setAuthorisationToken', '');
16-
17-
router.push({
18-
name: 'login',
19-
});
18+
logout({ commit }) {
19+
commit('resetAuthorisation');
20+
router.push({ name: 'login' });
2021
},
2122
},
2223
getters: {
23-
isLoggedIn: state => !!state.token.length,
24+
isLoggedIn: state => !!state.token,
2425
},
2526
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cli-plugin-kingscode-scaffold",
3-
"version": "0.10.1",
3+
"version": "0.11.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)