Skip to content

Commit 8faa8bd

Browse files
committed
refactor: change default fallback from 15 minutes to 1 minute and use ||
instead of ?? when reading env vars
1 parent 8fc8035 commit 8faa8bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/server/email.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ async function sendPasswordResetEmail(email: string, code: string, timeoutMinute
273273
export async function createEmailVerification(
274274
userId: string,
275275
email: string,
276-
timeoutMinutes = Number(env.PUBLIC_EMAIL_VERIFICATION_TIMEOUT_MINUTES ?? 15)
276+
timeoutMinutes = Number(env.PUBLIC_EMAIL_VERIFICATION_TIMEOUT_MINUTES || 1)
277277
) {
278278
const code = generateRandomOTP();
279279
// Store expiration as a Date object.
@@ -305,7 +305,7 @@ export async function createEmailVerification(
305305
export async function createPasswordReset(
306306
userId: string,
307307
email: string,
308-
timeoutMinutes = Number(env.PASSWORD_RESET_TIMEOUT_MINUTES ?? 15)
308+
timeoutMinutes = Number(env.PASSWORD_RESET_TIMEOUT_MINUTES || 1)
309309
) {
310310
const code = generateRandomOTP();
311311
// Store expiration as a Date object.

0 commit comments

Comments
 (0)