@better-auth-ui/core 1.6.28 → 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.
- package/dist/plugins/last-login-method/last-login-method-localization.d.ts +7 -0
- package/dist/plugins/last-login-method/last-login-method-plugin.d.ts +24 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/plugins.js +53 -47
- package/package.json +1 -1
- package/src/plugins/last-login-method/last-login-method-localization.ts +9 -0
- package/src/plugins/last-login-method/last-login-method-plugin.ts +29 -0
- package/src/plugins.ts +2 -0
|
@@ -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
|
+
};
|
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
|
@@ -46,29 +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
57
|
magicLinkSent: "Check your email for the magic link",
|
|
52
58
|
magicLinkSentTo: "We sent a magic link to {{email}}"
|
|
53
|
-
},
|
|
59
|
+
}, p = { signIn: [
|
|
54
60
|
"auth",
|
|
55
61
|
"signIn",
|
|
56
62
|
"magicLink"
|
|
57
|
-
] },
|
|
63
|
+
] }, m = n("magicLink", (e = {}) => ({
|
|
58
64
|
localization: {
|
|
59
|
-
...
|
|
65
|
+
...f,
|
|
60
66
|
...e.localization
|
|
61
67
|
},
|
|
62
68
|
viewPaths: { auth: {
|
|
63
69
|
magicLink: e.path ?? "magic-link",
|
|
64
70
|
magicLinkSent: e.sentPath ?? "magic-link-sent"
|
|
65
71
|
} }
|
|
66
|
-
})),
|
|
72
|
+
})), h = {
|
|
67
73
|
switchAccount: "Switch Account",
|
|
68
74
|
addAccount: "Add Account",
|
|
69
75
|
manageAccounts: "Manage accounts",
|
|
70
76
|
manageAccountsDescription: "Manage your accounts for secure access."
|
|
71
|
-
},
|
|
77
|
+
}, g = {
|
|
72
78
|
all: ["auth", "multiSession"],
|
|
73
79
|
revoke: [
|
|
74
80
|
"auth",
|
|
@@ -80,14 +86,14 @@ var r = {
|
|
|
80
86
|
"multiSession",
|
|
81
87
|
"setActive"
|
|
82
88
|
]
|
|
83
|
-
},
|
|
84
|
-
...
|
|
89
|
+
}, _ = n("multiSession", (e = {}) => ({ localization: {
|
|
90
|
+
...h,
|
|
85
91
|
...e.localization
|
|
86
|
-
} })),
|
|
92
|
+
} })), v = {
|
|
87
93
|
all: (t) => [...e.user(t), "multiSession"],
|
|
88
|
-
lists: (e) => [...
|
|
89
|
-
list: (e, t) => [...
|
|
90
|
-
},
|
|
94
|
+
lists: (e) => [...v.all(e), "list"],
|
|
95
|
+
list: (e, t) => [...v.lists(e), t ?? null]
|
|
96
|
+
}, y = {
|
|
91
97
|
accept: "Accept",
|
|
92
98
|
accepted: "Accepted",
|
|
93
99
|
actions: "Actions",
|
|
@@ -144,7 +150,7 @@ var r = {
|
|
|
144
150
|
status: "Status",
|
|
145
151
|
uploadLogo: "Upload logo",
|
|
146
152
|
userInvitationsEmptyDescription: "Invitations to join an organization will show up here."
|
|
147
|
-
},
|
|
153
|
+
}, b = {
|
|
148
154
|
all: ["auth", "organization"],
|
|
149
155
|
create: [
|
|
150
156
|
"auth",
|
|
@@ -206,9 +212,9 @@ var r = {
|
|
|
206
212
|
"organization",
|
|
207
213
|
"checkSlug"
|
|
208
214
|
]
|
|
209
|
-
},
|
|
215
|
+
}, x = n("organization", (e = {}) => {
|
|
210
216
|
let n = {
|
|
211
|
-
...
|
|
217
|
+
...y,
|
|
212
218
|
...e.localization
|
|
213
219
|
};
|
|
214
220
|
return {
|
|
@@ -236,38 +242,38 @@ var r = {
|
|
|
236
242
|
}
|
|
237
243
|
}
|
|
238
244
|
};
|
|
239
|
-
}),
|
|
245
|
+
}), S = {
|
|
240
246
|
all: (t) => [...e.user(t), "organization"],
|
|
241
|
-
lists: (e) => [...
|
|
242
|
-
list: (e, t) => [...
|
|
243
|
-
fullDetails: (e) => [...
|
|
244
|
-
fullDetail: (e, t) => [...
|
|
245
|
-
activeOrganizations: (e) => [...
|
|
246
|
-
activeOrganization: (e, t) => [...
|
|
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],
|
|
247
253
|
members: {
|
|
248
|
-
all: (e) => [...
|
|
249
|
-
lists: (e) => [...
|
|
250
|
-
list: (e, t) => [...
|
|
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]
|
|
251
257
|
},
|
|
252
258
|
invitations: {
|
|
253
|
-
all: (e) => [...
|
|
254
|
-
lists: (e) => [...
|
|
255
|
-
list: (e, t) => [...
|
|
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]
|
|
256
262
|
},
|
|
257
263
|
userInvitations: {
|
|
258
|
-
all: (e) => [...
|
|
259
|
-
lists: (e) => [...
|
|
260
|
-
list: (e, t) => [...
|
|
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]
|
|
261
267
|
},
|
|
262
268
|
permissions: {
|
|
263
|
-
all: (e) => [...
|
|
269
|
+
all: (e) => [...S.all(e), "permissions"],
|
|
264
270
|
has: (e, t) => [
|
|
265
|
-
...
|
|
271
|
+
...S.permissions.all(e),
|
|
266
272
|
"has",
|
|
267
273
|
t ?? null
|
|
268
274
|
]
|
|
269
275
|
}
|
|
270
|
-
},
|
|
276
|
+
}, C = {
|
|
271
277
|
passkey: "Passkey",
|
|
272
278
|
addPasskey: "Add passkey",
|
|
273
279
|
deletePasskey: "Delete passkey {{name}}",
|
|
@@ -277,7 +283,7 @@ var r = {
|
|
|
277
283
|
passkeysDescription: "Create a passkey to securely access your account.",
|
|
278
284
|
noPasskeys: "No passkeys",
|
|
279
285
|
name: "Name"
|
|
280
|
-
},
|
|
286
|
+
}, w = {
|
|
281
287
|
signIn: [
|
|
282
288
|
"auth",
|
|
283
289
|
"signIn",
|
|
@@ -293,22 +299,22 @@ var r = {
|
|
|
293
299
|
"passkey",
|
|
294
300
|
"deletePasskey"
|
|
295
301
|
]
|
|
296
|
-
},
|
|
297
|
-
...
|
|
302
|
+
}, T = n("passkey", (e = {}) => ({ localization: {
|
|
303
|
+
...C,
|
|
298
304
|
...e.localization
|
|
299
|
-
} })),
|
|
305
|
+
} })), E = {
|
|
300
306
|
all: (t) => [...e.user(t), "passkey"],
|
|
301
|
-
lists: (e) => [...
|
|
302
|
-
list: (e, t) => [...
|
|
303
|
-
},
|
|
307
|
+
lists: (e) => [...E.all(e), "list"],
|
|
308
|
+
list: (e, t) => [...E.lists(e), t ?? null]
|
|
309
|
+
}, D = {
|
|
304
310
|
appearance: "Appearance",
|
|
305
311
|
theme: "Theme",
|
|
306
312
|
system: "System",
|
|
307
313
|
light: "Light",
|
|
308
314
|
dark: "Dark"
|
|
309
|
-
},
|
|
315
|
+
}, O = n("theme", (e) => ({
|
|
310
316
|
localization: {
|
|
311
|
-
...
|
|
317
|
+
...D,
|
|
312
318
|
...e.localization
|
|
313
319
|
},
|
|
314
320
|
theme: e.theme ?? "system",
|
|
@@ -318,7 +324,7 @@ var r = {
|
|
|
318
324
|
"light",
|
|
319
325
|
"dark"
|
|
320
326
|
]
|
|
321
|
-
})),
|
|
327
|
+
})), k = {
|
|
322
328
|
username: "Username",
|
|
323
329
|
usernamePlaceholder: "Username",
|
|
324
330
|
usernameOrEmailPlaceholder: "Username or email",
|
|
@@ -326,16 +332,16 @@ var r = {
|
|
|
326
332
|
usernameTaken: "Username is already taken. Please try another.",
|
|
327
333
|
displayUsername: "Display Username",
|
|
328
334
|
displayUsernamePlaceholder: "Display Username"
|
|
329
|
-
},
|
|
335
|
+
}, A = {
|
|
330
336
|
signIn: [
|
|
331
337
|
"auth",
|
|
332
338
|
"signIn",
|
|
333
339
|
"username"
|
|
334
340
|
],
|
|
335
341
|
isUsernameAvailable: ["auth", "isUsernameAvailable"]
|
|
336
|
-
},
|
|
342
|
+
}, j = n("username", (e = {}) => {
|
|
337
343
|
let t = e.minUsernameLength ?? 3, n = e.maxUsernameLength ?? 30, r = {
|
|
338
|
-
...
|
|
344
|
+
...k,
|
|
339
345
|
...e.localization
|
|
340
346
|
};
|
|
341
347
|
return {
|
|
@@ -363,4 +369,4 @@ var r = {
|
|
|
363
369
|
};
|
|
364
370
|
});
|
|
365
371
|
//#endregion
|
|
366
|
-
export { r as apiKeyLocalization, i as apiKeyMutationKeys, a as apiKeyPlugin, o as apiKeyQueryKeys, s as deleteUserLocalization, c as deleteUserMutationKeys, l as deleteUserPlugin, u as
|
|
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
|
@@ -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
|
+
)
|
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"
|