feat(auth): verify google signup mobile before account creation
This commit is contained in:
@@ -127,7 +127,7 @@ export type GoogleOAuthFlowResponse =
|
||||
mobile: string;
|
||||
detail?: string;
|
||||
email: string;
|
||||
resolution: "existing_email_claim" | "existing_mobile_claim";
|
||||
resolution: "new_account" | "existing_email_claim" | "existing_mobile_claim";
|
||||
mobile_hint?: string | null;
|
||||
};
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ export default function GoogleAuthCallback() {
|
||||
const payload = await completeGoogleOAuthSignup(flow, mobile);
|
||||
applyFlowPayload(payload);
|
||||
if (payload.status === "claim_required") {
|
||||
toast.success(t.login.google.claimOtpSent);
|
||||
toast.success(payload.resolution === "new_account" ? t.login.toasts.verifySent : t.login.google.claimOtpSent);
|
||||
}
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : t.login.google.completeFailed;
|
||||
@@ -273,7 +273,8 @@ export default function GoogleAuthCallback() {
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
{step === "loading" && t.login.google.loadingTitle}
|
||||
{step === "collect_mobile" && t.login.google.collectMobileTitle}
|
||||
{step === "claim_required" && t.login.google.claimTitle}
|
||||
{step === "claim_required" &&
|
||||
(flowResolution === "new_account" ? t.login.signupVerifyTitle : t.login.google.claimTitle)}
|
||||
{step === "error" && t.login.google.errorTitle}
|
||||
</h1>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
@@ -285,7 +286,9 @@ export default function GoogleAuthCallback() {
|
||||
{step === "claim_required" &&
|
||||
(flowResolution === "existing_email_claim"
|
||||
? t.login.google.claimDescription(mobileHint || mobile)
|
||||
: t.login.google.mobileClaimDescription(mobile))}
|
||||
: flowResolution === "existing_mobile_claim"
|
||||
? t.login.google.mobileClaimDescription(mobile)
|
||||
: t.login.sentCodeDesc(mobile))}
|
||||
{step === "error" && (errorMessage || t.login.google.loadFailed)}
|
||||
</p>
|
||||
</div>
|
||||
@@ -372,7 +375,9 @@ export default function GoogleAuthCallback() {
|
||||
<p className="mb-3 text-sm text-slate-500 dark:text-slate-400">
|
||||
{flowResolution === "existing_email_claim"
|
||||
? t.login.google.claimDescription(mobileHint || mobile)
|
||||
: t.login.google.mobileClaimDescription(mobile)}
|
||||
: flowResolution === "existing_mobile_claim"
|
||||
? t.login.google.mobileClaimDescription(mobile)
|
||||
: t.login.sentCodeDesc(mobile)}
|
||||
</p>
|
||||
<Input
|
||||
id="google-claim-otp"
|
||||
|
||||
Reference in New Issue
Block a user