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 22
33Vuex module to interface with AWS Cognito
44
5- Docs Link: Coming Soon!
5+ Docs Link: [ https://cognito.vuetifyjs.com/ ] ( https://cognito.vuetifyjs.com/ )
66
77Install:
88``` 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.
77this .$store .dispatch (' cognito/fetchSession' )
88```
99
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+
1018### ` signInUser({ username: String, password: String }) `
1119Signs in an already created user and sets user obj in localstorage with ` USER ` key
1220
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ export default {
1313 } ) . catch ( reject )
1414 } ) . catch ( reject )
1515 } ) ,
16+ fetchJwtToken : ( { commit } ) =>
17+ new Promise ( ( resolve , reject ) => {
18+ Auth . currentSession ( ) . then ( session => {
19+ resolve ( session . getAccessToken ( ) . getJwtToken ( ) )
20+ } ) . catch ( reject )
21+ } ) ,
1622 signInUser : ( { commit } , credentials ) =>
1723 new Promise ( ( resolve , reject ) => {
1824 Auth . signIn ( credentials . username , credentials . password ) . then ( ( user ) => {
You can’t perform that action at this time.
0 commit comments