This repository was archived by the owner on Nov 21, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Vuex module to interface with AWS Cognito
4
4
5
- Docs Link: Coming Soon!
5
+ Docs Link: [ https://cognito.vuetifyjs.com/ ] ( https://cognito.vuetifyjs.com/ )
6
6
7
7
Install:
8
8
``` bash
Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ Fetches the latest information on the current user and session state.
7
7
this .$store .dispatch (' cognito/fetchSession' )
8
8
```
9
9
10
+ ### ` fetchJwtToken() `
11
+
12
+ Fetches the current jwtToken associated with the current user and session when available.
13
+
14
+ ``` js
15
+ this .$store .dispatch (' cognito/fetchJwtToken' )
16
+ ```
17
+
10
18
### ` signInUser({ username: String, password: String }) `
11
19
Signs in an already created user and sets user obj in localstorage with ` USER ` key
12
20
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ export default {
13
13
} ) . catch ( reject )
14
14
} ) . catch ( reject )
15
15
} ) ,
16
+ fetchJwtToken : ( { commit } ) =>
17
+ new Promise ( ( resolve , reject ) => {
18
+ Auth . currentSession ( ) . then ( session => {
19
+ resolve ( session . getAccessToken ( ) . getJwtToken ( ) )
20
+ } ) . catch ( reject )
21
+ } ) ,
16
22
signInUser : ( { commit } , credentials ) =>
17
23
new Promise ( ( resolve , reject ) => {
18
24
Auth . signIn ( credentials . username , credentials . password ) . then ( ( user ) => {
You can’t perform that action at this time.
0 commit comments