@erikey/react 0.4.30 → 0.4.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -390,12 +390,19 @@ export function SignUpForm({
|
|
|
390
390
|
`${basePath}/${viewPaths.TWO_FACTOR}${window.location.search}`
|
|
391
391
|
)
|
|
392
392
|
} else if ("token" in data && data.token) {
|
|
393
|
+
// Token present = verified or no verification required
|
|
393
394
|
await onSuccess()
|
|
394
|
-
} else if (
|
|
395
|
+
} else if (
|
|
396
|
+
data.user &&
|
|
397
|
+
(data.user as { emailVerified?: boolean }).emailVerified === false
|
|
398
|
+
) {
|
|
399
|
+
// No token + emailVerified: false = needs verification
|
|
400
|
+
// This is response-based (Better Auth pattern), not config-based
|
|
395
401
|
navigate(
|
|
396
402
|
`${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(email as string)}`
|
|
397
403
|
)
|
|
398
404
|
} else {
|
|
405
|
+
// Fallback: redirect to sign-in (e.g., link-based verification sent)
|
|
399
406
|
navigate(
|
|
400
407
|
`${basePath}/${viewPaths.SIGN_IN}${window.location.search}`
|
|
401
408
|
)
|