#✅ - Automatically sign users out after X days

4 messages · Page 1 of 1 (latest)

neon acorn
#

How can I set the expiration period for an authentication token so I can sign users out after x days?

dense cobalt
#

Customize your backend's auth user pool client as follows:

const { cfnUserPoolClient } = backend.auth.resources.cfnResources

cfnUserPoolClient.tokenValidityUnits = {
  accessToken: 'hours',
  idToken: 'hours',
  refreshToken: 'days',
}

cfnUserPoolClient.accessTokenValidity = 1
cfnUserPoolClient.idTokenValidity = 1
cfnUserPoolClient.refreshTokenValidity = 30
neon acorn
#

@dense cobalt Thanks so much!

slate skiffBOT
#

✅ - Automatically sign users out after X days