minor: heavily simplify server and app content. unify styling (#4)
All checks were successful
ci/woodpecker/push/push Pipeline was successful
All checks were successful
ci/woodpecker/push/push Pipeline was successful
Co-authored-by: Madison Grubb <madison@elastiflow.com> Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
@@ -1,15 +1,6 @@
|
||||
const DEFAULT_DAYS = 7
|
||||
const MIN_DAYS = 1
|
||||
const MAX_DAYS = 365
|
||||
const [MIN_DAYS, MAX_DAYS, DEFAULT_DAYS] = [1, 365, 7]
|
||||
|
||||
/**
|
||||
* Session lifetime in days (for cookie and DB expires_at). Uses SESSION_MAX_AGE_DAYS.
|
||||
* Clamped to 1–365 days.
|
||||
*/
|
||||
export function getSessionMaxAgeDays() {
|
||||
const raw = process.env.SESSION_MAX_AGE_DAYS != null
|
||||
? Number.parseInt(process.env.SESSION_MAX_AGE_DAYS, 10)
|
||||
: Number.NaN
|
||||
if (Number.isFinite(raw)) return Math.max(MIN_DAYS, Math.min(MAX_DAYS, raw))
|
||||
return DEFAULT_DAYS
|
||||
const raw = Number.parseInt(process.env.SESSION_MAX_AGE_DAYS ?? '', 10)
|
||||
return Number.isFinite(raw) ? Math.max(MIN_DAYS, Math.min(MAX_DAYS, raw)) : DEFAULT_DAYS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user