mirror of
https://github.com/dsoaress/link-free.git
synced 2026-08-18 23:46:04 +01:00
refactor: some adjustments
This commit is contained in:
15
src/constants/auth.ts
Normal file
15
src/constants/auth.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
const JWT_EXPIRES_IN = 15 // minutes
|
||||
const SESSION_EXPIRES_IN = 30 // days
|
||||
|
||||
const { JWT_SECRET } = process.env
|
||||
const SESSION_EXPIRES_IN_S = SESSION_EXPIRES_IN * 24 * 60 * 60
|
||||
const SESSION_EXPIRES_IN_MS = SESSION_EXPIRES_IN_S * 1000
|
||||
|
||||
if (!JWT_SECRET && !process.browser) throw new Error('JWT_SECRET is not defined')
|
||||
|
||||
export const authConstants = {
|
||||
JWT_SECRET,
|
||||
JWT_EXPIRES_IN,
|
||||
SESSION_EXPIRES_IN_S,
|
||||
SESSION_EXPIRES_IN_MS
|
||||
}
|
||||
Reference in New Issue
Block a user