@supabase/lite 0.7.0 → 0.7.1-next.2

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
@@ -302,9 +302,22 @@ interface AuthConfig {
302
302
  enable_signup?: boolean;
303
303
  enable_confirmations?: boolean;
304
304
  double_confirm_changes?: boolean;
305
+ otp_length?: number;
306
+ otp_expiry?: number;
307
+ smtp?: {
308
+ sender_name?: string;
309
+ admin_email?: string;
310
+ };
311
+ template?: Partial<Record<EmailTemplateType, EmailTemplateConfig>>;
305
312
  };
306
313
  enable_confirmations?: boolean;
307
314
  site_url?: string;
315
+ additional_redirect_urls?: string[];
316
+ }
317
+ type EmailTemplateType = "invite" | "confirmation" | "recovery" | "magic_link" | "email_change";
318
+ interface EmailTemplateConfig {
319
+ subject?: string;
320
+ content_path?: string;
308
321
  }
309
322
 
310
323
  type Dialect$1 = "postgres" | "sqlite";
@@ -541,6 +554,11 @@ interface MailMeta {
541
554
  tokenNew?: string;
542
555
  tokenHashNew?: string;
543
556
  redirectTo?: string;
557
+ /** Current (old) email — used as the `Email` template var for email change. */
558
+ currentEmail?: string;
559
+ /** Pending (new) email — used as the `NewEmail` template var for email change. */
560
+ newEmail?: string;
561
+ data?: string;
544
562
  }
545
563
 
546
564
  declare class AuthService {
@@ -553,6 +571,18 @@ declare class AuthService {
553
571
  private sessionTimeboxSeconds?;
554
572
  private sessionInactivitySeconds?;
555
573
  constructor(repo: AuthRepository, config: AuthConfig, mailer: Mailer);
574
+ private get otpLength();
575
+ private get otpExpirySeconds();
576
+ /**
577
+ * Returns a safe post-verification redirect target: `redirectTo` if allowed,
578
+ * otherwise `site_url`. Mirrors GoTrue's `IsRedirectURLValid`:
579
+ * - same scheme + host + port as `site_url` (any path; port ignored for
580
+ * loopback hosts), or
581
+ * - a glob match of `additional_redirect_urls` against the full URL
582
+ * (patterns use `.`/`/` as separators, so `*` does not cross them but
583
+ * `**` does).
584
+ */
585
+ resolveEmailRedirect(redirectTo?: string | null): string;
556
586
  signUp(email: string | undefined, password: string | undefined, data?: Record<string, unknown>): Promise<{
557
587
  user: UserResponse;
558
588
  session?: SessionResponse;
@@ -587,7 +617,8 @@ declare class AuthService {
587
617
  private mapUserToResponse;
588
618
  private mapIdentityToResponse;
589
619
  private findUserByTokenAndType;
590
- private otpMatchesStoredTokenHash;
620
+ private static readonly SENT_AT_COLUMN;
621
+ private isTokenExpired;
591
622
  private getTokenColumnsForType;
592
623
  private createAuditLog;
593
624
  }
@@ -1120,6 +1151,15 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
1120
1151
  status: 200;
1121
1152
  };
1122
1153
  };
1154
+ } & {
1155
+ "/verify": {
1156
+ $get: {
1157
+ input: {};
1158
+ output: undefined;
1159
+ outputFormat: "redirect";
1160
+ status: 303;
1161
+ };
1162
+ };
1123
1163
  } & {
1124
1164
  "/recover": {
1125
1165
  $post: {