Created
May 15, 2019 19:44
-
-
Save gdbate/e47fe170a3d86878c596257e32d02542 to your computer and use it in GitHub Desktop.
Vue: Customizing Amplify Authentication - Fetching JWT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Dependencies =============== | |
| import {Auth} from 'aws-amplify' | |
| // Function =================== | |
| async function getJWT(state){ | |
| if(state.account.authorized){ | |
| const session = await Auth.currentSession() | |
| const jwt = session.idToken.jwtToken | |
| }else{ | |
| //handle not logged in | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment