feat: get data from jwt
This commit is contained in:
		| @@ -41,6 +41,7 @@ export class Authentication { | ||||
|     try { | ||||
|       const result = await http.post('/auth/login').send({username, password}); | ||||
|  | ||||
|       this.accessToken = result.body.access_token; | ||||
|       TokenUtil.setAccessToken(result.body.access_token); | ||||
|       TokenUtil.persistToken(); | ||||
|       runInAction(() => { | ||||
| @@ -60,5 +61,6 @@ export class Authentication { | ||||
|     TokenUtil.clearAccessToken(); | ||||
|     TokenUtil.persistToken(); | ||||
|     this.isLoggedIn = false; | ||||
|     this.accessToken = ''; | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -18,6 +18,7 @@ export class Store { | ||||
|         TokenUtil.loadToken(); | ||||
|         if (TokenUtil.accessToken) { | ||||
|             this.authentication.isLoggedIn = true; | ||||
|             this.authentication.accessToken = TokenUtil.accessToken; | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user