fix(auth): centralize JWT secret with registerAsync to ensure consistent signing and verification

This commit is contained in:
parsa aghaei committed 2026-08-16 15:11:05 +03:30
1 parent 1a21c4c642
commit 0c32985ce2
3 files changed
+22 -14

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
export const DEFAULT_JWT_SECRET =
'canina_jwt_fallback_access_secret_32_characters_minimum_len_2026';
export const DEFAULT_JWT_REFRESH_SECRET =
'canina_jwt_fallback_refresh_secret_32_characters_minimum_len_2026';
export const getJwtSecret = (): string =>
process.env.JWT_ACCESS_SECRET ||
process.env.JWT_SECRET ||
DEFAULT_JWT_SECRET;
export const getJwtRefreshSecret = (): string =>
process.env.JWT_REFRESH_SECRET ||
DEFAULT_JWT_REFRESH_SECRET;