@better-auth-ui/core 1.6.27 → 1.6.29

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.
@@ -11,6 +11,7 @@ var e = {
11
11
  confirmPassword: "Confirm password",
12
12
  confirmPasswordPlaceholder: "Confirm your password",
13
13
  checkYourEmail: "Check your email for a verification link",
14
+ checkYourEmailTitle: "Check your email",
14
15
  continueWith: "Continue with {{provider}}",
15
16
  email: "Email",
16
17
  emailPlaceholder: "m@example.com",
@@ -38,6 +39,7 @@ var e = {
38
39
  rememberYourPassword: "Remember your password?",
39
40
  resend: "Resend",
40
41
  resendIn: "Resend in {{seconds}}s",
42
+ resetLinkSentTo: "We sent a password reset link to {{email}}",
41
43
  resetPassword: "Reset Password",
42
44
  sendResetLink: "Send reset link",
43
45
  showPassword: "Show password",
@@ -144,6 +146,7 @@ var s = {
144
146
  signUp: "sign-up",
145
147
  forgotPassword: "forgot-password",
146
148
  resetPassword: "reset-password",
149
+ resetLinkSent: "reset-link-sent",
147
150
  signOut: "sign-out",
148
151
  verifyEmail: "verify-email"
149
152
  },
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./create-auth-plugin-CSJlOwwp.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./create-auth-plugin-DvOQZp9O.js";
2
2
  //#region src/config/additional-fields-config.ts
3
3
  function l(e, t) {
4
4
  if (e.type === "boolean") return t === "on" || t === "true";
@@ -12,6 +12,8 @@ export declare const localization: {
12
12
  confirmPasswordPlaceholder: string;
13
13
  /** @remarks `"Check your email for a verification link"` */
14
14
  checkYourEmail: string;
15
+ /** @remarks `"Check your email"` */
16
+ checkYourEmailTitle: string;
15
17
  /** @remarks `"Continue with {{provider}}"` */
16
18
  continueWith: string;
17
19
  /** @remarks `"Email"` */
@@ -66,6 +68,8 @@ export declare const localization: {
66
68
  resend: string;
67
69
  /** @remarks `"Resend in {{seconds}}s"` */
68
70
  resendIn: string;
71
+ /** @remarks `"We sent a password reset link to {{email}}"` */
72
+ resetLinkSentTo: string;
69
73
  /** @remarks `"Reset Password"` */
70
74
  resetPassword: string;
71
75
  /** @remarks `"Send reset link"` */
@@ -22,6 +22,11 @@ export interface AuthViewPaths {
22
22
  * @default "reset-password"
23
23
  */
24
24
  resetPassword: string;
25
+ /**
26
+ * Path segment for the reset-link-sent confirmation view
27
+ * @default "reset-link-sent"
28
+ */
29
+ resetLinkSent: string;
25
30
  /**
26
31
  * Path segment for the sign-out view
27
32
  * @default "sign-out"
@@ -0,0 +1,7 @@
1
+ export declare const lastLoginMethodLocalization: {
2
+ /** @remarks `"Last used"` */
3
+ lastUsed: string;
4
+ /** @remarks `"Last"` */
5
+ lastUsedShort: string;
6
+ };
7
+ export type LastLoginMethodLocalization = typeof lastLoginMethodLocalization;
@@ -0,0 +1,24 @@
1
+ import { LastLoginMethodLocalization } from './last-login-method-localization';
2
+ export type LastLoginMethodPluginOptions = {
3
+ /**
4
+ * Override the plugin's default localization strings.
5
+ * @remarks `LastLoginMethodLocalization`
6
+ */
7
+ localization?: Partial<LastLoginMethodLocalization>;
8
+ };
9
+ /**
10
+ * Enables last-login-method indicators in supported authentication views.
11
+ *
12
+ * Pair this UI plugin with Better Auth's `lastLoginMethod()` server plugin
13
+ * and `lastLoginMethodClient()` client plugin.
14
+ */
15
+ export declare const lastLoginMethodPlugin: ((options?: LastLoginMethodPluginOptions | undefined) => {
16
+ localization: {
17
+ lastUsed: string;
18
+ lastUsedShort: string;
19
+ };
20
+ } & {
21
+ id: "lastLoginMethod";
22
+ }) & {
23
+ id: "lastLoginMethod";
24
+ };
@@ -5,5 +5,7 @@ export declare const magicLinkLocalization: {
5
5
  sendMagicLink: string;
6
6
  /** @remarks `"Check your email for the magic link"` */
7
7
  magicLinkSent: string;
8
+ /** @remarks `"We sent a magic link to {{email}}"` */
9
+ magicLinkSentTo: string;
8
10
  };
9
11
  export type MagicLinkLocalization = typeof magicLinkLocalization;
@@ -1,9 +1,11 @@
1
1
  import { MagicLinkLocalization } from './magic-link-localization';
2
2
  declare module "../../lib/view-paths" {
3
- /** Widens `AuthViewPaths` by adding the `"magicLink"` path when this plugin is imported. */
3
+ /** Widens `AuthViewPaths` with the magic-link paths when this plugin is imported. */
4
4
  interface AuthViewPaths {
5
5
  /** @default "magic-link" */
6
6
  magicLink?: string;
7
+ /** @default "magic-link-sent" */
8
+ magicLinkSent?: string;
7
9
  }
8
10
  }
9
11
  export type MagicLinkPluginOptions = {
@@ -18,16 +20,24 @@ export type MagicLinkPluginOptions = {
18
20
  * @default "magic-link"
19
21
  */
20
22
  path?: string;
23
+ /**
24
+ * URL segment for the magic-link-sent confirmation view.
25
+ * @remarks `string`
26
+ * @default "magic-link-sent"
27
+ */
28
+ sentPath?: string;
21
29
  };
22
30
  export declare const magicLinkPlugin: ((options?: MagicLinkPluginOptions | undefined) => {
23
31
  localization: {
24
32
  magicLink: string;
25
33
  sendMagicLink: string;
26
34
  magicLinkSent: string;
35
+ magicLinkSentTo: string;
27
36
  };
28
37
  viewPaths: {
29
38
  auth: {
30
39
  magicLink: string;
40
+ magicLinkSent: string;
31
41
  };
32
42
  };
33
43
  } & {
package/dist/plugins.d.ts CHANGED
@@ -5,6 +5,8 @@ export * from './plugins/api-key/api-key-query-keys';
5
5
  export * from './plugins/delete-user/delete-user-localization';
6
6
  export * from './plugins/delete-user/delete-user-mutation-keys';
7
7
  export * from './plugins/delete-user/delete-user-plugin';
8
+ export * from './plugins/last-login-method/last-login-method-localization';
9
+ export * from './plugins/last-login-method/last-login-method-plugin';
8
10
  export * from './plugins/magic-link/magic-link-localization';
9
11
  export * from './plugins/magic-link/magic-link-mutation-keys';
10
12
  export * from './plugins/magic-link/magic-link-plugin';
package/dist/plugins.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as e, r as t, t as n } from "./create-auth-plugin-CSJlOwwp.js";
1
+ import { n as e, r as t, t as n } from "./create-auth-plugin-DvOQZp9O.js";
2
2
  //#region src/plugins/api-key/api-key-localization.ts
3
3
  var r = {
4
4
  apiKey: "API key",
@@ -46,25 +46,35 @@ var r = {
46
46
  },
47
47
  sendDeleteAccountVerification: e.sendDeleteAccountVerification ?? !1
48
48
  })), u = {
49
+ lastUsed: "Last used",
50
+ lastUsedShort: "Last"
51
+ }, d = n("lastLoginMethod", (e = {}) => ({ localization: {
52
+ ...u,
53
+ ...e.localization
54
+ } })), f = {
49
55
  magicLink: "Magic Link",
50
56
  sendMagicLink: "Send Magic Link",
51
- magicLinkSent: "Check your email for the magic link"
52
- }, d = { signIn: [
57
+ magicLinkSent: "Check your email for the magic link",
58
+ magicLinkSentTo: "We sent a magic link to {{email}}"
59
+ }, p = { signIn: [
53
60
  "auth",
54
61
  "signIn",
55
62
  "magicLink"
56
- ] }, f = n("magicLink", (e = {}) => ({
63
+ ] }, m = n("magicLink", (e = {}) => ({
57
64
  localization: {
58
- ...u,
65
+ ...f,
59
66
  ...e.localization
60
67
  },
61
- viewPaths: { auth: { magicLink: e.path ?? "magic-link" } }
62
- })), p = {
68
+ viewPaths: { auth: {
69
+ magicLink: e.path ?? "magic-link",
70
+ magicLinkSent: e.sentPath ?? "magic-link-sent"
71
+ } }
72
+ })), h = {
63
73
  switchAccount: "Switch Account",
64
74
  addAccount: "Add Account",
65
75
  manageAccounts: "Manage accounts",
66
76
  manageAccountsDescription: "Manage your accounts for secure access."
67
- }, m = {
77
+ }, g = {
68
78
  all: ["auth", "multiSession"],
69
79
  revoke: [
70
80
  "auth",
@@ -76,14 +86,14 @@ var r = {
76
86
  "multiSession",
77
87
  "setActive"
78
88
  ]
79
- }, h = n("multiSession", (e = {}) => ({ localization: {
80
- ...p,
89
+ }, _ = n("multiSession", (e = {}) => ({ localization: {
90
+ ...h,
81
91
  ...e.localization
82
- } })), g = {
92
+ } })), v = {
83
93
  all: (t) => [...e.user(t), "multiSession"],
84
- lists: (e) => [...g.all(e), "list"],
85
- list: (e, t) => [...g.lists(e), t ?? null]
86
- }, _ = {
94
+ lists: (e) => [...v.all(e), "list"],
95
+ list: (e, t) => [...v.lists(e), t ?? null]
96
+ }, y = {
87
97
  accept: "Accept",
88
98
  accepted: "Accepted",
89
99
  actions: "Actions",
@@ -140,7 +150,7 @@ var r = {
140
150
  status: "Status",
141
151
  uploadLogo: "Upload logo",
142
152
  userInvitationsEmptyDescription: "Invitations to join an organization will show up here."
143
- }, v = {
153
+ }, b = {
144
154
  all: ["auth", "organization"],
145
155
  create: [
146
156
  "auth",
@@ -202,9 +212,9 @@ var r = {
202
212
  "organization",
203
213
  "checkSlug"
204
214
  ]
205
- }, y = n("organization", (e = {}) => {
215
+ }, x = n("organization", (e = {}) => {
206
216
  let n = {
207
- ..._,
217
+ ...y,
208
218
  ...e.localization
209
219
  };
210
220
  return {
@@ -232,38 +242,38 @@ var r = {
232
242
  }
233
243
  }
234
244
  };
235
- }), b = {
245
+ }), S = {
236
246
  all: (t) => [...e.user(t), "organization"],
237
- lists: (e) => [...b.all(e), "list"],
238
- list: (e, t) => [...b.lists(e), t ?? null],
239
- fullDetails: (e) => [...b.all(e), "fullDetails"],
240
- fullDetail: (e, t) => [...b.fullDetails(e), t ?? null],
241
- activeOrganizations: (e) => [...b.all(e), "active"],
242
- activeOrganization: (e, t) => [...b.activeOrganizations(e), t ?? null],
247
+ lists: (e) => [...S.all(e), "list"],
248
+ list: (e, t) => [...S.lists(e), t ?? null],
249
+ fullDetails: (e) => [...S.all(e), "fullDetails"],
250
+ fullDetail: (e, t) => [...S.fullDetails(e), t ?? null],
251
+ activeOrganizations: (e) => [...S.all(e), "active"],
252
+ activeOrganization: (e, t) => [...S.activeOrganizations(e), t ?? null],
243
253
  members: {
244
- all: (e) => [...b.all(e), "members"],
245
- lists: (e) => [...b.members.all(e), "list"],
246
- list: (e, t) => [...b.members.lists(e), t ?? null]
254
+ all: (e) => [...S.all(e), "members"],
255
+ lists: (e) => [...S.members.all(e), "list"],
256
+ list: (e, t) => [...S.members.lists(e), t ?? null]
247
257
  },
248
258
  invitations: {
249
- all: (e) => [...b.all(e), "invitations"],
250
- lists: (e) => [...b.invitations.all(e), "list"],
251
- list: (e, t) => [...b.invitations.lists(e), t ?? null]
259
+ all: (e) => [...S.all(e), "invitations"],
260
+ lists: (e) => [...S.invitations.all(e), "list"],
261
+ list: (e, t) => [...S.invitations.lists(e), t ?? null]
252
262
  },
253
263
  userInvitations: {
254
- all: (e) => [...b.all(e), "userInvitations"],
255
- lists: (e) => [...b.userInvitations.all(e), "list"],
256
- list: (e, t) => [...b.userInvitations.lists(e), t ?? null]
264
+ all: (e) => [...S.all(e), "userInvitations"],
265
+ lists: (e) => [...S.userInvitations.all(e), "list"],
266
+ list: (e, t) => [...S.userInvitations.lists(e), t ?? null]
257
267
  },
258
268
  permissions: {
259
- all: (e) => [...b.all(e), "permissions"],
269
+ all: (e) => [...S.all(e), "permissions"],
260
270
  has: (e, t) => [
261
- ...b.permissions.all(e),
271
+ ...S.permissions.all(e),
262
272
  "has",
263
273
  t ?? null
264
274
  ]
265
275
  }
266
- }, x = {
276
+ }, C = {
267
277
  passkey: "Passkey",
268
278
  addPasskey: "Add passkey",
269
279
  deletePasskey: "Delete passkey {{name}}",
@@ -273,7 +283,7 @@ var r = {
273
283
  passkeysDescription: "Create a passkey to securely access your account.",
274
284
  noPasskeys: "No passkeys",
275
285
  name: "Name"
276
- }, S = {
286
+ }, w = {
277
287
  signIn: [
278
288
  "auth",
279
289
  "signIn",
@@ -289,22 +299,22 @@ var r = {
289
299
  "passkey",
290
300
  "deletePasskey"
291
301
  ]
292
- }, C = n("passkey", (e = {}) => ({ localization: {
293
- ...x,
302
+ }, T = n("passkey", (e = {}) => ({ localization: {
303
+ ...C,
294
304
  ...e.localization
295
- } })), w = {
305
+ } })), E = {
296
306
  all: (t) => [...e.user(t), "passkey"],
297
- lists: (e) => [...w.all(e), "list"],
298
- list: (e, t) => [...w.lists(e), t ?? null]
299
- }, T = {
307
+ lists: (e) => [...E.all(e), "list"],
308
+ list: (e, t) => [...E.lists(e), t ?? null]
309
+ }, D = {
300
310
  appearance: "Appearance",
301
311
  theme: "Theme",
302
312
  system: "System",
303
313
  light: "Light",
304
314
  dark: "Dark"
305
- }, E = n("theme", (e) => ({
315
+ }, O = n("theme", (e) => ({
306
316
  localization: {
307
- ...T,
317
+ ...D,
308
318
  ...e.localization
309
319
  },
310
320
  theme: e.theme ?? "system",
@@ -314,7 +324,7 @@ var r = {
314
324
  "light",
315
325
  "dark"
316
326
  ]
317
- })), D = {
327
+ })), k = {
318
328
  username: "Username",
319
329
  usernamePlaceholder: "Username",
320
330
  usernameOrEmailPlaceholder: "Username or email",
@@ -322,16 +332,16 @@ var r = {
322
332
  usernameTaken: "Username is already taken. Please try another.",
323
333
  displayUsername: "Display Username",
324
334
  displayUsernamePlaceholder: "Display Username"
325
- }, O = {
335
+ }, A = {
326
336
  signIn: [
327
337
  "auth",
328
338
  "signIn",
329
339
  "username"
330
340
  ],
331
341
  isUsernameAvailable: ["auth", "isUsernameAvailable"]
332
- }, k = n("username", (e = {}) => {
342
+ }, j = n("username", (e = {}) => {
333
343
  let t = e.minUsernameLength ?? 3, n = e.maxUsernameLength ?? 30, r = {
334
- ...D,
344
+ ...k,
335
345
  ...e.localization
336
346
  };
337
347
  return {
@@ -359,4 +369,4 @@ var r = {
359
369
  };
360
370
  });
361
371
  //#endregion
362
- export { r as apiKeyLocalization, i as apiKeyMutationKeys, a as apiKeyPlugin, o as apiKeyQueryKeys, s as deleteUserLocalization, c as deleteUserMutationKeys, l as deleteUserPlugin, u as magicLinkLocalization, d as magicLinkMutationKeys, f as magicLinkPlugin, p as multiSessionLocalization, m as multiSessionMutationKeys, h as multiSessionPlugin, g as multiSessionQueryKeys, _ as organizationLocalization, v as organizationMutationKeys, y as organizationPlugin, b as organizationQueryKeys, x as passkeyLocalization, S as passkeyMutationKeys, C as passkeyPlugin, w as passkeyQueryKeys, T as themeLocalization, E as themePlugin, D as usernameLocalization, O as usernameMutationKeys, k as usernamePlugin };
372
+ export { r as apiKeyLocalization, i as apiKeyMutationKeys, a as apiKeyPlugin, o as apiKeyQueryKeys, s as deleteUserLocalization, c as deleteUserMutationKeys, l as deleteUserPlugin, u as lastLoginMethodLocalization, d as lastLoginMethodPlugin, f as magicLinkLocalization, p as magicLinkMutationKeys, m as magicLinkPlugin, h as multiSessionLocalization, g as multiSessionMutationKeys, _ as multiSessionPlugin, v as multiSessionQueryKeys, y as organizationLocalization, b as organizationMutationKeys, x as organizationPlugin, S as organizationQueryKeys, C as passkeyLocalization, w as passkeyMutationKeys, T as passkeyPlugin, E as passkeyQueryKeys, D as themeLocalization, O as themePlugin, k as usernameLocalization, A as usernameMutationKeys, j as usernamePlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth-ui/core",
3
- "version": "1.6.27",
3
+ "version": "1.6.29",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",
@@ -18,6 +18,9 @@ export const localization = {
18
18
  /** @remarks `"Check your email for a verification link"` */
19
19
  checkYourEmail: "Check your email for a verification link",
20
20
 
21
+ /** @remarks `"Check your email"` */
22
+ checkYourEmailTitle: "Check your email",
23
+
21
24
  /** @remarks `"Continue with {{provider}}"` */
22
25
  continueWith: "Continue with {{provider}}",
23
26
 
@@ -99,6 +102,9 @@ export const localization = {
99
102
  /** @remarks `"Resend in {{seconds}}s"` */
100
103
  resendIn: "Resend in {{seconds}}s",
101
104
 
105
+ /** @remarks `"We sent a password reset link to {{email}}"` */
106
+ resetLinkSentTo: "We sent a password reset link to {{email}}",
107
+
102
108
  /** @remarks `"Reset Password"` */
103
109
  resetPassword: "Reset Password",
104
110
 
@@ -22,6 +22,11 @@ export interface AuthViewPaths {
22
22
  * @default "reset-password"
23
23
  */
24
24
  resetPassword: string
25
+ /**
26
+ * Path segment for the reset-link-sent confirmation view
27
+ * @default "reset-link-sent"
28
+ */
29
+ resetLinkSent: string
25
30
  /**
26
31
  * Path segment for the sign-out view
27
32
  * @default "sign-out"
@@ -66,6 +71,7 @@ export const viewPaths: ViewPaths = {
66
71
  signUp: "sign-up",
67
72
  forgotPassword: "forgot-password",
68
73
  resetPassword: "reset-password",
74
+ resetLinkSent: "reset-link-sent",
69
75
  signOut: "sign-out",
70
76
  verifyEmail: "verify-email"
71
77
  },
@@ -0,0 +1,9 @@
1
+ export const lastLoginMethodLocalization = {
2
+ /** @remarks `"Last used"` */
3
+ lastUsed: "Last used",
4
+
5
+ /** @remarks `"Last"` */
6
+ lastUsedShort: "Last"
7
+ }
8
+
9
+ export type LastLoginMethodLocalization = typeof lastLoginMethodLocalization
@@ -0,0 +1,29 @@
1
+ import { createAuthPlugin } from "../../lib/create-auth-plugin"
2
+ import {
3
+ type LastLoginMethodLocalization,
4
+ lastLoginMethodLocalization
5
+ } from "./last-login-method-localization"
6
+
7
+ export type LastLoginMethodPluginOptions = {
8
+ /**
9
+ * Override the plugin's default localization strings.
10
+ * @remarks `LastLoginMethodLocalization`
11
+ */
12
+ localization?: Partial<LastLoginMethodLocalization>
13
+ }
14
+
15
+ /**
16
+ * Enables last-login-method indicators in supported authentication views.
17
+ *
18
+ * Pair this UI plugin with Better Auth's `lastLoginMethod()` server plugin
19
+ * and `lastLoginMethodClient()` client plugin.
20
+ */
21
+ export const lastLoginMethodPlugin = createAuthPlugin(
22
+ "lastLoginMethod",
23
+ (options: LastLoginMethodPluginOptions = {}) => ({
24
+ localization: {
25
+ ...lastLoginMethodLocalization,
26
+ ...options.localization
27
+ }
28
+ })
29
+ )
@@ -4,7 +4,9 @@ export const magicLinkLocalization = {
4
4
  /** @remarks `"Send Magic Link"` */
5
5
  sendMagicLink: "Send Magic Link",
6
6
  /** @remarks `"Check your email for the magic link"` */
7
- magicLinkSent: "Check your email for the magic link"
7
+ magicLinkSent: "Check your email for the magic link",
8
+ /** @remarks `"We sent a magic link to {{email}}"` */
9
+ magicLinkSentTo: "We sent a magic link to {{email}}"
8
10
  }
9
11
 
10
12
  export type MagicLinkLocalization = typeof magicLinkLocalization
@@ -8,10 +8,12 @@ import {
8
8
  } from "./magic-link-localization"
9
9
 
10
10
  declare module "../../lib/view-paths" {
11
- /** Widens `AuthViewPaths` by adding the `"magicLink"` path when this plugin is imported. */
11
+ /** Widens `AuthViewPaths` with the magic-link paths when this plugin is imported. */
12
12
  interface AuthViewPaths {
13
13
  /** @default "magic-link" */
14
14
  magicLink?: string
15
+ /** @default "magic-link-sent" */
16
+ magicLinkSent?: string
15
17
  }
16
18
  }
17
19
 
@@ -27,6 +29,12 @@ export type MagicLinkPluginOptions = {
27
29
  * @default "magic-link"
28
30
  */
29
31
  path?: string
32
+ /**
33
+ * URL segment for the magic-link-sent confirmation view.
34
+ * @remarks `string`
35
+ * @default "magic-link-sent"
36
+ */
37
+ sentPath?: string
30
38
  }
31
39
 
32
40
  export const magicLinkPlugin = createAuthPlugin(
@@ -34,7 +42,10 @@ export const magicLinkPlugin = createAuthPlugin(
34
42
  (options: MagicLinkPluginOptions = {}) => ({
35
43
  localization: { ...magicLinkLocalization, ...options.localization },
36
44
  viewPaths: {
37
- auth: { magicLink: options.path ?? "magic-link" }
45
+ auth: {
46
+ magicLink: options.path ?? "magic-link",
47
+ magicLinkSent: options.sentPath ?? "magic-link-sent"
48
+ }
38
49
  }
39
50
  })
40
51
  )
package/src/plugins.ts CHANGED
@@ -5,6 +5,8 @@ export * from "./plugins/api-key/api-key-query-keys"
5
5
  export * from "./plugins/delete-user/delete-user-localization"
6
6
  export * from "./plugins/delete-user/delete-user-mutation-keys"
7
7
  export * from "./plugins/delete-user/delete-user-plugin"
8
+ export * from "./plugins/last-login-method/last-login-method-localization"
9
+ export * from "./plugins/last-login-method/last-login-method-plugin"
8
10
  export * from "./plugins/magic-link/magic-link-localization"
9
11
  export * from "./plugins/magic-link/magic-link-mutation-keys"
10
12
  export * from "./plugins/magic-link/magic-link-plugin"