0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

chore(core): add default ttl settings (#1429)

add default ttl settings to avoid oidc warning
This commit is contained in:
simeng-li 2022-07-06 20:33:25 +08:00 committed by GitHub
parent 78407fc6c9
commit 0240e5cac2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,6 +132,16 @@ export default async function initOidc(app: Koa): Promise<Provider> {
return refreshTokenTtl ?? defaultRefreshTokenTtl;
},
AccessToken: (ctx, token) => {
if (token.resourceServer) {
return token.resourceServer.accessTokenTTL ?? 60 * 60; // 1 hour in seconds
}
return 60 * 60; // 1 hour in seconds
},
Interaction: 3600 /* 1 hour in seconds */,
Session: 1_209_600 /* 14 days in seconds */,
Grant: 1_209_600 /* 14 days in seconds */,
},
extraTokenClaims: async (_ctx, token) => {
// AccessToken type is not exported by default, need to asset token is AccessToken