📜  aws amplify 获取 JWT TOKEN - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:07.743000             🧑  作者: Mango

代码示例1
// Gets current user session token after cognito sign in. 

Auth.currentSession().then(res=>{
  let accessToken = res.getAccessToken()
  let jwt = accessToken.getJwtToken()
  //You can print them to see the full objects
  console.log(`myAccessToken: ${JSON.stringify(accessToken)}`)
  console.log(`myJwt: ${jwt}`)
})