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

feat: make access token duration configurable when creating client/secret

This commit is contained in:
2022-11-10 19:43:06 +05:00
parent 4c874c2c39
commit 2413c05fea
6 changed files with 44 additions and 13 deletions

View File

@@ -11,6 +11,11 @@ export interface ClientPayload {
* @example "someRandomCryptoString"
*/
clientSecret: string
/**
* Number of days in which access token will expire
* @example 1
*/
accessTokenExpiryDays?: number
}
const ClientSchema = new Schema<ClientPayload>({
@@ -21,6 +26,10 @@ const ClientSchema = new Schema<ClientPayload>({
clientSecret: {
type: String,
required: true
},
accessTokenExpiryDays: {
type: Number,
default: 1
}
})