refac: gera url de reset de senha com base no .env

This commit is contained in:
2026-05-18 19:28:14 -05:00
parent 7153caa0ac
commit c1ad6b4cfe
5 changed files with 22 additions and 16 deletions

View File

@@ -11,6 +11,7 @@ export interface AuthRuntimeConfig {
kid: string
refreshTokenPepper: string
passwordResetTokenPepper: string
passwordResetBaseUrl: string
}
/**
@@ -85,6 +86,7 @@ export function getAuthRuntimeConfig(event?: H3Event): AuthRuntimeConfig {
const refreshTokenPepper = String(runtimeConfig.refreshTokenPepper ?? '').trim()
const passwordResetTokenPepper =
String(runtimeConfig.passwordResetTokenPepper ?? '').trim() || refreshTokenPepper
const passwordResetBaseUrl = String(runtimeConfig.passwordResetBaseUrl ?? '').trim()
return {
issuer,
@@ -99,6 +101,7 @@ export function getAuthRuntimeConfig(event?: H3Event): AuthRuntimeConfig {
privateKeyPem: normalizePem(String(runtimeConfig.jwtPrivateKeyPem ?? ''), 'JWT private key'),
publicKeyPem: normalizePem(String(runtimeConfig.jwtPublicKeyPem ?? ''), 'JWT public key'),
refreshTokenPepper,
passwordResetTokenPepper
passwordResetTokenPepper,
passwordResetBaseUrl
}
}