Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save gdbate/e47fe170a3d86878c596257e32d02542 to your computer and use it in GitHub Desktop.

Select an option

Save gdbate/e47fe170a3d86878c596257e32d02542 to your computer and use it in GitHub Desktop.
Vue: Customizing Amplify Authentication - Fetching JWT
// 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