fix: address review comments

- Clarify button text: 'Request a New Link' instead of 'Send Me a New Link'
- Update copy to explain user needs to enter email
- Tighten access_denied check to avoid false positives (must be combined with otp_expired)
This commit is contained in:
Bentlybro
2026-02-16 12:08:02 +00:00
parent 80e9f4008f
commit 6b6d3fec11
2 changed files with 7 additions and 6 deletions

View File

@@ -32,12 +32,14 @@ function ResetPasswordContent() {
if (error || errorCode) {
// Check if this is an expired/used link error
const descLower = errorDescription?.toLowerCase() || "";
const isExpiredOrUsed =
error === "link_expired" ||
errorCode === "otp_expired" ||
error === "access_denied" ||
errorDescription?.toLowerCase().includes("expired") ||
errorDescription?.toLowerCase().includes("invalid");
descLower.includes("expired") ||
descLower.includes("invalid") ||
// access_denied alone is too broad - only treat as expired when combined with otp indicators
(error === "access_denied" && errorCode === "otp_expired");
if (isExpiredOrUsed) {
setShowExpiredMessage(true);

View File

@@ -19,8 +19,7 @@ export function ExpiredLinkMessage({
Your reset password link has expired or has already been used
</Text>
<Text variant="body-medium" className="text-center text-muted-foreground">
Click below to recover your password. A new link will be sent to your
email.
Enter your email below to request a new password reset link.
</Text>
<Button
variant="primary"
@@ -29,7 +28,7 @@ export function ExpiredLinkMessage({
disabled={linkSent}
className="w-full"
>
{linkSent ? "Check Your Email" : "Send Me a New Link"}
{linkSent ? "Check Your Email" : "Request a New Link"}
</Button>
<div className="flex items-center gap-1">
<Text variant="body-small" className="text-muted-foreground">