From e1566c0c1232294bdbb27eab2227e5318aa4660e Mon Sep 17 00:00:00 2001 From: pilcrow Date: Fri, 16 Feb 2024 09:27:59 +0900 Subject: [PATCH] Fix `isWithinExpirationDate()` (#1439) --- .../guides/email-and-password/email-verification-codes.md | 4 ++-- .../guides/email-and-password/email-verification-links.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/guides/email-and-password/email-verification-codes.md b/docs/pages/guides/email-and-password/email-verification-codes.md index 8a7913aaf..d77c65040 100644 --- a/docs/pages/guides/email-and-password/email-verification-codes.md +++ b/docs/pages/guides/email-and-password/email-verification-codes.md @@ -119,7 +119,7 @@ When resending verification emails, make sure to implement rate limiting based o Validate the verification code by comparing it against your database and checking the expiration and email. Make sure to invalidate all user sessions. ```ts -import { isWithinExpiration } from "oslo"; +import { isWithinExpirationDate } from "oslo"; import type { User } from "lucia"; app.post("/email-verification", async () => { @@ -174,7 +174,7 @@ async function verifyVerificationCode(user: User, code: string): Promise { // ... @@ -131,7 +131,7 @@ app.get("email-verification/:token", async () => { } await db.commit(); - if (!token || !isWithinExpiration(token.expires_at)) { + if (!token || !isWithinExpirationDate(token.expires_at)) { return new Response(null, { status: 400 });