📅  最后修改于: 2022-03-11 15:04:07.743000             🧑  作者: Mango
// 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}`)
})