@better-auth-ui/core 1.6.23 → 1.6.25

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.
@@ -0,0 +1,18 @@
1
+ export type EmailProviderLink = {
2
+ /** Human-readable provider name, e.g. `"Gmail"` or `"GMX"`. */
3
+ companyProvider: string;
4
+ /** Direct URL to the provider's webmail login, e.g. `"https://mail.google.com/mail/"`. */
5
+ loginUrl: string;
6
+ };
7
+ /**
8
+ * Resolve the webmail login link for an email address from its domain.
9
+ *
10
+ * Mirrors the synchronous domain lookup of `@mikkelscheike/email-provider-links`
11
+ * but reads its bundled provider dataset directly so it stays browser-safe — the
12
+ * package's runtime depends on Node built-ins (`fs`/`dns`) and cannot be bundled
13
+ * for the client. Covers 130+ providers including niche ones like `gmx.de`.
14
+ *
15
+ * @param email - Full email address, e.g. `"jane@gmx.de"`.
16
+ * @returns The matching provider link, or `null` for unknown/custom domains.
17
+ */
18
+ export declare function getEmailProviderLink(email: string): EmailProviderLink | null;
@@ -4,10 +4,14 @@ export declare const localization: {
4
4
  account: string;
5
5
  /** @remarks `"Already have an account?"` */
6
6
  alreadyHaveAnAccount: string;
7
+ /** @remarks `"Already verified your email?"` */
8
+ alreadyVerifiedYourEmail: string;
7
9
  /** @remarks `"Confirm password"` */
8
10
  confirmPassword: string;
9
11
  /** @remarks `"Confirm your password"` */
10
12
  confirmPasswordPlaceholder: string;
13
+ /** @remarks `"Check your email for a verification link"` */
14
+ checkYourEmail: string;
11
15
  /** @remarks `"Continue with {{provider}}"` */
12
16
  continueWith: string;
13
17
  /** @remarks `"Email"` */
@@ -36,6 +40,8 @@ export declare const localization: {
36
40
  newPassword: string;
37
41
  /** @remarks `"Enter your new password"` */
38
42
  newPasswordPlaceholder: string;
43
+ /** @remarks `"Open {{provider}}"` */
44
+ openEmailProvider: string;
39
45
  /** @remarks `"OR"` */
40
46
  or: string;
41
47
  /** @remarks `"Password"` */
@@ -58,6 +64,8 @@ export declare const localization: {
58
64
  rememberYourPassword: string;
59
65
  /** @remarks `"Resend"` */
60
66
  resend: string;
67
+ /** @remarks `"Resend in {{seconds}}s"` */
68
+ resendIn: string;
61
69
  /** @remarks `"Reset Password"` */
62
70
  resetPassword: string;
63
71
  /** @remarks `"Send reset link"` */
@@ -72,8 +80,8 @@ export declare const localization: {
72
80
  signUp: string;
73
81
  /** @remarks `"Verification email sent!"` */
74
82
  verificationEmailSent: string;
75
- /** @remarks `"Verify your email"` */
76
- verifyYourEmail: string;
83
+ /** @remarks `"Verify Email"` */
84
+ verifyEmail: string;
77
85
  };
78
86
  settings: {
79
87
  /** @remarks `"Account"` */
@@ -27,6 +27,11 @@ export interface AuthViewPaths {
27
27
  * @default "sign-out"
28
28
  */
29
29
  signOut: string;
30
+ /**
31
+ * Path segment for the verify email view
32
+ * @default "verify-email"
33
+ */
34
+ verifyEmail: string;
30
35
  }
31
36
  /**
32
37
  * View path segments for settings routes.
package/dist/plugins.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as e, r as t, t as n } from "./create-auth-plugin-BHcy7UTO.js";
1
+ import { n as e, r as t, t as n } from "./create-auth-plugin-BA7PI8QW.js";
2
2
  //#region src/plugins/api-key/api-key-localization.ts
3
3
  var r = {
4
4
  apiKey: "API key",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth-ui/core",
3
- "version": "1.6.23",
3
+ "version": "1.6.25",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",
@@ -25,10 +25,12 @@
25
25
  }
26
26
  },
27
27
  "devDependencies": {
28
+ "@mikkelscheike/email-provider-links": "^5.1.8",
28
29
  "better-auth": "^1.6.19",
29
30
  "vitest": "^4.1.9"
30
31
  },
31
32
  "peerDependencies": {
33
+ "@mikkelscheike/email-provider-links": ">=5.1.8",
32
34
  "better-auth": ">=1.6.19"
33
35
  },
34
36
  "repository": {
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ export * from "./lib/auth-query-keys"
5
5
  export * from "./lib/base-paths"
6
6
  export * from "./lib/create-auth-plugin"
7
7
  export * from "./lib/deep-partial"
8
+ export * from "./lib/email-provider-links"
8
9
  export * from "./lib/localization"
9
10
  export * from "./lib/provider-names"
10
11
  export * from "./lib/utils"
@@ -0,0 +1,62 @@
1
+ import emailProviderData from "@mikkelscheike/email-provider-links/providers/emailproviders.json" with {
2
+ type: "json"
3
+ }
4
+
5
+ type RawEmailProvider = {
6
+ companyProvider: string
7
+ loginUrl?: string | null
8
+ domains?: string[]
9
+ }
10
+
11
+ export type EmailProviderLink = {
12
+ /** Human-readable provider name, e.g. `"Gmail"` or `"GMX"`. */
13
+ companyProvider: string
14
+ /** Direct URL to the provider's webmail login, e.g. `"https://mail.google.com/mail/"`. */
15
+ loginUrl: string
16
+ }
17
+
18
+ let domainMap: Map<string, EmailProviderLink> | undefined
19
+
20
+ function getDomainMap(): Map<string, EmailProviderLink> {
21
+ if (domainMap) return domainMap
22
+
23
+ domainMap = new Map()
24
+
25
+ const { providers } = emailProviderData as { providers: RawEmailProvider[] }
26
+ for (const provider of providers) {
27
+ if (!provider.loginUrl) continue
28
+
29
+ for (const domain of provider.domains ?? []) {
30
+ domainMap.set(domain.toLowerCase(), {
31
+ companyProvider: provider.companyProvider,
32
+ loginUrl: provider.loginUrl
33
+ })
34
+ }
35
+ }
36
+
37
+ return domainMap
38
+ }
39
+
40
+ /**
41
+ * Resolve the webmail login link for an email address from its domain.
42
+ *
43
+ * Mirrors the synchronous domain lookup of `@mikkelscheike/email-provider-links`
44
+ * but reads its bundled provider dataset directly so it stays browser-safe — the
45
+ * package's runtime depends on Node built-ins (`fs`/`dns`) and cannot be bundled
46
+ * for the client. Covers 130+ providers including niche ones like `gmx.de`.
47
+ *
48
+ * @param email - Full email address, e.g. `"jane@gmx.de"`.
49
+ * @returns The matching provider link, or `null` for unknown/custom domains.
50
+ */
51
+ export function getEmailProviderLink(email: string): EmailProviderLink | null {
52
+ const atIndex = email.lastIndexOf("@")
53
+ if (atIndex === -1) return null
54
+
55
+ const domain = email
56
+ .slice(atIndex + 1)
57
+ .trim()
58
+ .toLowerCase()
59
+ if (!domain) return null
60
+
61
+ return getDomainMap().get(domain) ?? null
62
+ }
@@ -6,12 +6,18 @@ export const localization = {
6
6
  /** @remarks `"Already have an account?"` */
7
7
  alreadyHaveAnAccount: "Already have an account?",
8
8
 
9
+ /** @remarks `"Already verified your email?"` */
10
+ alreadyVerifiedYourEmail: "Already verified your email?",
11
+
9
12
  /** @remarks `"Confirm password"` */
10
13
  confirmPassword: "Confirm password",
11
14
 
12
15
  /** @remarks `"Confirm your password"` */
13
16
  confirmPasswordPlaceholder: "Confirm your password",
14
17
 
18
+ /** @remarks `"Check your email for a verification link"` */
19
+ checkYourEmail: "Check your email for a verification link",
20
+
15
21
  /** @remarks `"Continue with {{provider}}"` */
16
22
  continueWith: "Continue with {{provider}}",
17
23
 
@@ -54,6 +60,9 @@ export const localization = {
54
60
  /** @remarks `"Enter your new password"` */
55
61
  newPasswordPlaceholder: "Enter your new password",
56
62
 
63
+ /** @remarks `"Open {{provider}}"` */
64
+ openEmailProvider: "Open {{provider}}",
65
+
57
66
  /** @remarks `"OR"` */
58
67
  or: "OR",
59
68
 
@@ -87,6 +96,9 @@ export const localization = {
87
96
  /** @remarks `"Resend"` */
88
97
  resend: "Resend",
89
98
 
99
+ /** @remarks `"Resend in {{seconds}}s"` */
100
+ resendIn: "Resend in {{seconds}}s",
101
+
90
102
  /** @remarks `"Reset Password"` */
91
103
  resetPassword: "Reset Password",
92
104
 
@@ -108,8 +120,8 @@ export const localization = {
108
120
  /** @remarks `"Verification email sent!"` */
109
121
  verificationEmailSent: "Verification email sent!",
110
122
 
111
- /** @remarks `"Verify your email"` */
112
- verifyYourEmail: "Verify your email"
123
+ /** @remarks `"Verify Email"` */
124
+ verifyEmail: "Verify Email"
113
125
  },
114
126
  settings: {
115
127
  /** @remarks `"Account"` */
@@ -27,6 +27,11 @@ export interface AuthViewPaths {
27
27
  * @default "sign-out"
28
28
  */
29
29
  signOut: string
30
+ /**
31
+ * Path segment for the verify email view
32
+ * @default "verify-email"
33
+ */
34
+ verifyEmail: string
30
35
  }
31
36
 
32
37
  /**
@@ -61,7 +66,8 @@ export const viewPaths: ViewPaths = {
61
66
  signUp: "sign-up",
62
67
  forgotPassword: "forgot-password",
63
68
  resetPassword: "reset-password",
64
- signOut: "sign-out"
69
+ signOut: "sign-out",
70
+ verifyEmail: "verify-email"
65
71
  },
66
72
  settings: {
67
73
  account: "account",