-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement sessions and revoking possibility (#28)
- Loading branch information
1 parent
23668a8
commit ca0a7da
Showing
29 changed files
with
810 additions
and
171 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import dotenv from 'dotenv'; | ||
import { getJwtSecret } from './getters'; | ||
import { getJwtSecret, getJwtExpirationPeriod } from './getters'; | ||
|
||
dotenv.config(); | ||
|
||
export const JWT_SECRET = getJwtSecret(); | ||
export const PORT = Number(process.env.PORT ?? '3000'); | ||
export const isDevelopment = process.env.NODE_ENV === 'development'; | ||
export const AUTH_SIGNUP_ENABLED = Boolean(process.env.AUTH_SIGNUP_ENABLED); | ||
// https://www.npmjs.com/package/jsonwebtoken for `expiresIn` format | ||
export const JWT_EXPIRATION_PERIOD: number | string = process.env.JWT_EXPIRATION_PERIOD_SECONDS ? Number(process.env.JWT_EXPIRATION_PERIOD_SECONDS) : '7d'; | ||
export const JWT_EXPIRATION_PERIOD: string = getJwtExpirationPeriod(); |
Oops, something went wrong.