@supabase/lite 0.7.0 → 0.7.1-next.1

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.
@@ -930,9 +930,22 @@ interface AuthConfig {
930
930
  enable_signup?: boolean;
931
931
  enable_confirmations?: boolean;
932
932
  double_confirm_changes?: boolean;
933
+ otp_length?: number;
934
+ otp_expiry?: number;
935
+ smtp?: {
936
+ sender_name?: string;
937
+ admin_email?: string;
938
+ };
939
+ template?: Partial<Record<EmailTemplateType, EmailTemplateConfig>>;
933
940
  };
934
941
  enable_confirmations?: boolean;
935
942
  site_url?: string;
943
+ additional_redirect_urls?: string[];
944
+ }
945
+ type EmailTemplateType = "invite" | "confirmation" | "recovery" | "magic_link" | "email_change";
946
+ interface EmailTemplateConfig {
947
+ subject?: string;
948
+ content_path?: string;
936
949
  }
937
950
 
938
951
  type Dialect$1 = "postgres" | "sqlite";
@@ -1043,6 +1056,11 @@ interface MailMeta {
1043
1056
  tokenNew?: string;
1044
1057
  tokenHashNew?: string;
1045
1058
  redirectTo?: string;
1059
+ /** Current (old) email — used as the `Email` template var for email change. */
1060
+ currentEmail?: string;
1061
+ /** Pending (new) email — used as the `NewEmail` template var for email change. */
1062
+ newEmail?: string;
1063
+ data?: string;
1046
1064
  }
1047
1065
 
1048
1066
  declare class AuthService {
@@ -1055,6 +1073,18 @@ declare class AuthService {
1055
1073
  private sessionTimeboxSeconds?;
1056
1074
  private sessionInactivitySeconds?;
1057
1075
  constructor(repo: AuthRepository, config: AuthConfig, mailer: Mailer);
1076
+ private get otpLength();
1077
+ private get otpExpirySeconds();
1078
+ /**
1079
+ * Returns a safe post-verification redirect target: `redirectTo` if allowed,
1080
+ * otherwise `site_url`. Mirrors GoTrue's `IsRedirectURLValid`:
1081
+ * - same scheme + host + port as `site_url` (any path; port ignored for
1082
+ * loopback hosts), or
1083
+ * - a glob match of `additional_redirect_urls` against the full URL
1084
+ * (patterns use `.`/`/` as separators, so `*` does not cross them but
1085
+ * `**` does).
1086
+ */
1087
+ resolveEmailRedirect(redirectTo?: string | null): string;
1058
1088
  signUp(email: string | undefined, password: string | undefined, data?: Record<string, unknown>): Promise<{
1059
1089
  user: UserResponse;
1060
1090
  session?: SessionResponse;
@@ -1089,7 +1119,8 @@ declare class AuthService {
1089
1119
  private mapUserToResponse;
1090
1120
  private mapIdentityToResponse;
1091
1121
  private findUserByTokenAndType;
1092
- private otpMatchesStoredTokenHash;
1122
+ private static readonly SENT_AT_COLUMN;
1123
+ private isTokenExpired;
1093
1124
  private getTokenColumnsForType;
1094
1125
  private createAuditLog;
1095
1126
  }
@@ -1621,6 +1652,15 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
1621
1652
  status: 200;
1622
1653
  };
1623
1654
  };
1655
+ } & {
1656
+ "/verify": {
1657
+ $get: {
1658
+ input: {};
1659
+ output: undefined;
1660
+ outputFormat: "redirect";
1661
+ status: 303;
1662
+ };
1663
+ };
1624
1664
  } & {
1625
1665
  "/recover": {
1626
1666
  $post: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supabase/lite",
3
- "version": "0.7.0",
3
+ "version": "0.7.1-next.1",
4
4
  "description": "Lightweight TypeScript-native Supabase implementation on SQLite (alpha). PostgREST + GoTrue compatible — use @supabase/supabase-js as-is.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",