mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
46 lines
971 B
TypeScript
46 lines
971 B
TypeScript
import mongoose, { Schema } from 'mongoose'
|
|
|
|
export interface ConfigurationType {
|
|
/**
|
|
* SecretOrPrivateKey to sign Access Token
|
|
* @example "someRandomCryptoString"
|
|
*/
|
|
ACCESS_TOKEN_SECRET: string
|
|
/**
|
|
* SecretOrPrivateKey to sign Refresh Token
|
|
* @example "someRandomCryptoString"
|
|
*/
|
|
REFRESH_TOKEN_SECRET: string
|
|
/**
|
|
* SecretOrPrivateKey to sign Auth Code
|
|
* @example "someRandomCryptoString"
|
|
*/
|
|
AUTH_CODE_SECRET: string
|
|
/**
|
|
* Secret used to sign the session cookie
|
|
* @example "someRandomCryptoString"
|
|
*/
|
|
SESSION_SECRET: string
|
|
}
|
|
|
|
const ConfigurationSchema = new Schema<ConfigurationType>({
|
|
ACCESS_TOKEN_SECRET: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
REFRESH_TOKEN_SECRET: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
AUTH_CODE_SECRET: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
SESSION_SECRET: {
|
|
type: String,
|
|
required: true
|
|
}
|
|
})
|
|
|
|
export default mongoose.model('Configuration', ConfigurationSchema)
|