mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-16 09:46:07 -05:00
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:
@@ -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);
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user