File tree Expand file tree Collapse file tree
Authorisation/src/views/authorisation
Default/src/store/modules Expand file tree Collapse file tree Original file line number Diff line number Diff 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 `
Original file line number Diff line number Diff 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' );
Original file line number Diff line number Diff line change 11import router from '../../router' ;
22
3+ const initialState = ( { token : null } ) ;
4+
35export 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} ;
Original file line number Diff line number Diff line change 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" : {
You can’t perform that action at this time.
0 commit comments