misc: add proper grace period for max ttl and descriptive comment

This commit is contained in:
Sheen Capadngan
2025-05-28 16:24:23 +08:00
parent 767159bf8f
commit d08510ebe4

View File

@@ -122,7 +122,9 @@ export const identityUaServiceFactory = ({
}
: {
accessTokenTTL: identityUa.accessTokenPeriod,
accessTokenMaxTTL: identityUa.accessTokenPeriod
// Setting Max TTL to 2 × period ensures that clients can always renew their token
// at least once, and matches client logic that checks if renewing would exceed Max TTL.
accessTokenMaxTTL: 2 * identityUa.accessTokenPeriod
};
const identityAccessToken = await identityUaDAL.transaction(async (tx) => {