ab-ecosystem-sso 0.1.12 → 0.1.13

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/dist/index.d.ts CHANGED
@@ -514,6 +514,58 @@ export declare interface UserWallets {
514
514
 
515
515
  export declare function useSession(): SessionContextValue;
516
516
 
517
+ /**
518
+ * Email-verification screen for a `/verify/:token` route.
519
+ *
520
+ * <VerifyEmail
521
+ * projectId="…"
522
+ * token={params.token}
523
+ * onVerified={() => navigate("/login")}
524
+ * onLoginClick={() => navigate("/login")}
525
+ * onSignupClick={() => navigate("/signup")}
526
+ * />
527
+ */
528
+ export declare function VerifyEmail(props: VerifyEmailProps): JSX_2.Element;
529
+
530
+ /**
531
+ * POST /auth/verify-email — confirms an email address using the token from the
532
+ * verification link, plus a captcha token when the project requires one.
533
+ *
534
+ * The endpoint can answer HTTP 200 with `{ success: false }`, so a successful
535
+ * verification requires BOTH a 2xx status and `success === true`; anything else
536
+ * throws AuthApiError.
537
+ */
538
+ export declare function verifyEmailApi(projectId: string, data: VerifyEmailRequest, apiBaseUrl?: string): Promise<VerifyEmailResponse>;
539
+
540
+ /**
541
+ * Email-verification screen for a `/verify/:token` route. `onSuccess` doesn't
542
+ * apply here (no session is created), so it's omitted in favour of `onVerified`.
543
+ */
544
+ export declare interface VerifyEmailProps extends Omit<AuthComponentBaseProps, "onSuccess"> {
545
+ /**
546
+ * The verification token from the `/verify/:token` route — pass it from your
547
+ * router's params. Falls back to the last segment of `window.location.pathname`.
548
+ */
549
+ token?: string;
550
+ /** Called once the email is verified — send the user to your login route here. */
551
+ onVerified?: () => void;
552
+ /** Navigate to your login route (shown on success and on failure). */
553
+ onLoginClick?: () => void;
554
+ /** Navigate to your signup route (shown on failure). */
555
+ onSignupClick?: () => void;
556
+ }
557
+
558
+ export declare interface VerifyEmailRequest {
559
+ /** The verification token from the emailed link (the `/verify/:token` path param). */
560
+ token: string;
561
+ captchaToken?: string;
562
+ }
563
+
564
+ export declare interface VerifyEmailResponse {
565
+ success: boolean;
566
+ message?: string;
567
+ }
568
+
517
569
  export declare interface VerifyTwoFactorRequest {
518
570
  email: string;
519
571
  password: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ab-ecosystem-sso",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "main": "dist/ab-ecosystem-sso.cjs",
6
6
  "module": "dist/ab-ecosystem-sso.js",