1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-04 21:30:05 +00:00

feat: make refresh token duration configurable

This commit is contained in:
2022-11-10 21:02:20 +05:00
parent 2413c05fea
commit abd5c64b4a
6 changed files with 37 additions and 9 deletions

View File

@@ -16,6 +16,11 @@ export interface ClientPayload {
* @example 1
*/
accessTokenExpiryDays?: number
/**
* Number of days in which access token will expire
* @example 30
*/
refreshTokenExpiryDays?: number
}
const ClientSchema = new Schema<ClientPayload>({
@@ -30,6 +35,10 @@ const ClientSchema = new Schema<ClientPayload>({
accessTokenExpiryDays: {
type: Number,
default: 1
},
refreshTokenExpiryDays: {
type: Number,
default: 30
}
})