@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erikey/react",
3
- "version": "0.4.30",
3
+ "version": "0.4.31",
4
4
  "description": "React SDK for Erikey - B2B authentication and user management. UI components based on better-auth-ui.",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -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 (emailVerification?.otp) {
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
  )