aws-mobile-appsync-sdk-js icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-js copied to clipboard

`auth` option of `createAuthLink` of `aws-appsync-auth-link` cache the `jwtToken`?

Open yaquawa opened this issue 4 years ago • 1 comments

considering this piece of code.

const url = 'xxx'

const jwtToken = async () => {
  return await getJwtToken()
}

const auth = {
  type: 'AMAZON_COGNITO_USER_POOLS',
  jwtToken,
}

const userPoolsAuthLink = createAuthLink({ url, region, auth })

the jwtToken is a function, which should be called for every request, but seems like the package aws-appsync-auth-link only called it once at the first time. This will cause problem when the jwtToken expired.

yaquawa avatar Feb 13 '21 10:02 yaquawa

Any updates on this?

edemagbenyo avatar Oct 25 '21 15:10 edemagbenyo