fix: add "Use a different email" button to verify-email page (#28398)
* fix: add "Use a different email" button to verify-email page Closes #28393 * fix: address review feedback on verify-email page - Use signOut({ callbackUrl }) instead of manual redirect - Stack buttons vertically with flex-col --------- Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
This commit is contained in:
co-authored by
Romit
parent
c496801655
commit
a694202c46
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useSession } from "next-auth/react";
|
||||
import { signOut, useSession } from "next-auth/react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import posthog from "posthog-js";
|
||||
import { useEffect } from "react";
|
||||
@@ -83,16 +83,25 @@ function VerifyEmailPage() {
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
<Button
|
||||
color="minimal"
|
||||
loading={mutation.isPending}
|
||||
onClick={() => {
|
||||
posthog.capture("verify_email_resend_clicked");
|
||||
showToast(t("send_email"), "success");
|
||||
mutation.mutate();
|
||||
}}>
|
||||
{t("resend_email")}
|
||||
</Button>
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
<Button
|
||||
color="minimal"
|
||||
loading={mutation.isPending}
|
||||
onClick={() => {
|
||||
posthog.capture("verify_email_resend_clicked");
|
||||
showToast(t("send_email"), "success");
|
||||
mutation.mutate();
|
||||
}}>
|
||||
{t("resend_email")}
|
||||
</Button>
|
||||
<Button
|
||||
color="minimal"
|
||||
onClick={() => {
|
||||
signOut({ callbackUrl: "/signup" });
|
||||
}}>
|
||||
{t("use_different_email")}
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -2264,6 +2264,7 @@
|
||||
"you": "You",
|
||||
"or_continue_with": "Or continue with",
|
||||
"resend_email": "Resend email",
|
||||
"use_different_email": "Use a different email",
|
||||
"member_already_invited": "Member has already been invited",
|
||||
"already_in_use_error": "Username already in use",
|
||||
"enter_email_or_username": "Enter an email or username",
|
||||
|
||||
Reference in New Issue
Block a user