mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(frontend): forward all Supabase error params and toast on expired links
Forward error_code and error_description from Supabase through the callback to the reset-password page. Also show a toast with the Supabase error detail when a link is expired, so the exact error is always visible for debugging.
This commit is contained in:
@@ -42,6 +42,14 @@ function ResetPasswordContent() {
|
||||
|
||||
if (isExpiredOrUsed) {
|
||||
setShowExpiredMessage(true);
|
||||
// Also show a toast with the Supabase error detail for debugging
|
||||
if (errorDescription) {
|
||||
toast({
|
||||
title: "Link Expired",
|
||||
description: errorDescription,
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Show toast for other errors
|
||||
const errorMessage =
|
||||
|
||||
@@ -29,9 +29,13 @@ export async function GET(request: NextRequest) {
|
||||
errorDescription || error || "Missing verification code",
|
||||
);
|
||||
|
||||
return NextResponse.redirect(
|
||||
`${origin}/reset-password?error=${errorParam}`,
|
||||
);
|
||||
const redirectUrl = new URL(`${origin}/reset-password`);
|
||||
redirectUrl.searchParams.set("error", errorParam);
|
||||
if (errorCode) redirectUrl.searchParams.set("error_code", errorCode);
|
||||
if (errorDescription)
|
||||
redirectUrl.searchParams.set("error_description", errorDescription);
|
||||
|
||||
return NextResponse.redirect(redirectUrl.toString());
|
||||
}
|
||||
|
||||
return NextResponse.redirect(
|
||||
|
||||
Reference in New Issue
Block a user