better-auth-ui 3.2.21 → 3.2.23
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.cjs +11 -11
- package/dist/index.js +11 -11
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
- package/src/components/auth/auth-view.tsx +65 -66
- package/src/components/organization/organization-logo-card.tsx +2 -2
- package/src/components/organization/organization-switcher.tsx +14 -14
- package/src/components/password-input.tsx +1 -1
- package/src/components/settings/account/update-avatar-card.tsx +1 -1
- package/src/components/settings/api-key/api-key-cell.tsx +1 -1
- package/src/components/user-button.tsx +1 -1
package/package.json
CHANGED
|
@@ -91,8 +91,8 @@ export function AuthView({
|
|
|
91
91
|
socialLayout = !credentials
|
|
92
92
|
? "vertical"
|
|
93
93
|
: social?.providers && social.providers.length > 2
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
? "horizontal"
|
|
95
|
+
: "vertical"
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
const path = pathProp ?? pathname?.split("/").pop()
|
|
@@ -227,16 +227,16 @@ export function AuthView({
|
|
|
227
227
|
>
|
|
228
228
|
<Separator
|
|
229
229
|
className={cn(
|
|
230
|
-
"
|
|
230
|
+
"w-auto! grow",
|
|
231
231
|
classNames?.separator
|
|
232
232
|
)}
|
|
233
233
|
/>
|
|
234
|
-
<span className="
|
|
234
|
+
<span className="shrink-0 text-muted-foreground text-sm">
|
|
235
235
|
{localization.OR_CONTINUE_WITH}
|
|
236
236
|
</span>
|
|
237
237
|
<Separator
|
|
238
238
|
className={cn(
|
|
239
|
-
"
|
|
239
|
+
"w-auto! grow",
|
|
240
240
|
classNames?.separator
|
|
241
241
|
)}
|
|
242
242
|
/>
|
|
@@ -246,61 +246,61 @@ export function AuthView({
|
|
|
246
246
|
<div className="grid gap-4">
|
|
247
247
|
{(social?.providers?.length ||
|
|
248
248
|
genericOAuth?.providers?.length) && (
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
249
|
+
<div
|
|
250
|
+
className={cn(
|
|
251
|
+
"flex w-full items-center justify-between gap-4",
|
|
252
|
+
socialLayout === "horizontal" &&
|
|
253
253
|
"flex-wrap",
|
|
254
|
-
|
|
254
|
+
socialLayout === "vertical" &&
|
|
255
255
|
"flex-col",
|
|
256
|
-
|
|
256
|
+
socialLayout === "grid" &&
|
|
257
257
|
"grid grid-cols-2"
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
258
|
+
)}
|
|
259
|
+
>
|
|
260
|
+
{social?.providers?.map((provider) => {
|
|
261
|
+
const socialProvider =
|
|
262
|
+
socialProviders.find(
|
|
263
|
+
(socialProvider) =>
|
|
264
|
+
socialProvider.provider ===
|
|
265
|
+
provider
|
|
266
|
+
)
|
|
267
|
+
if (!socialProvider) return null
|
|
268
|
+
return (
|
|
269
|
+
<ProviderButton
|
|
270
|
+
key={provider}
|
|
271
|
+
classNames={classNames}
|
|
272
|
+
callbackURL={callbackURL}
|
|
273
|
+
isSubmitting={isSubmitting}
|
|
274
|
+
localization={localization}
|
|
275
|
+
provider={socialProvider}
|
|
276
|
+
redirectTo={redirectTo}
|
|
277
|
+
setIsSubmitting={
|
|
278
|
+
setIsSubmitting
|
|
279
|
+
}
|
|
280
|
+
socialLayout={socialLayout}
|
|
281
|
+
/>
|
|
266
282
|
)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
setIsSubmitting
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
classNames={classNames}
|
|
289
|
-
callbackURL={callbackURL}
|
|
290
|
-
isSubmitting={isSubmitting}
|
|
291
|
-
localization={localization}
|
|
292
|
-
provider={provider}
|
|
293
|
-
redirectTo={redirectTo}
|
|
294
|
-
setIsSubmitting={
|
|
295
|
-
setIsSubmitting
|
|
296
|
-
}
|
|
297
|
-
socialLayout={socialLayout}
|
|
298
|
-
other
|
|
299
|
-
/>
|
|
300
|
-
)
|
|
301
|
-
)}
|
|
302
|
-
</div>
|
|
303
|
-
)}
|
|
283
|
+
})}
|
|
284
|
+
{genericOAuth?.providers?.map(
|
|
285
|
+
(provider) => (
|
|
286
|
+
<ProviderButton
|
|
287
|
+
key={provider.provider}
|
|
288
|
+
classNames={classNames}
|
|
289
|
+
callbackURL={callbackURL}
|
|
290
|
+
isSubmitting={isSubmitting}
|
|
291
|
+
localization={localization}
|
|
292
|
+
provider={provider}
|
|
293
|
+
redirectTo={redirectTo}
|
|
294
|
+
setIsSubmitting={
|
|
295
|
+
setIsSubmitting
|
|
296
|
+
}
|
|
297
|
+
socialLayout={socialLayout}
|
|
298
|
+
other
|
|
299
|
+
/>
|
|
300
|
+
)
|
|
301
|
+
)}
|
|
302
|
+
</div>
|
|
303
|
+
)}
|
|
304
304
|
|
|
305
305
|
{passkey &&
|
|
306
306
|
[
|
|
@@ -332,8 +332,8 @@ export function AuthView({
|
|
|
332
332
|
)}
|
|
333
333
|
>
|
|
334
334
|
{view === "SIGN_IN" ||
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
view === "MAGIC_LINK" ||
|
|
336
|
+
view === "EMAIL_OTP" ? (
|
|
337
337
|
localization.DONT_HAVE_AN_ACCOUNT
|
|
338
338
|
) : view === "SIGN_UP" ? (
|
|
339
339
|
localization.ALREADY_HAVE_AN_ACCOUNT
|
|
@@ -342,17 +342,16 @@ export function AuthView({
|
|
|
342
342
|
)}
|
|
343
343
|
|
|
344
344
|
{view === "SIGN_IN" ||
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
345
|
+
view === "MAGIC_LINK" ||
|
|
346
|
+
view === "EMAIL_OTP" ||
|
|
347
|
+
view === "SIGN_UP" ? (
|
|
348
348
|
<Link
|
|
349
349
|
className={cn(
|
|
350
350
|
"text-foreground underline",
|
|
351
351
|
classNames?.footerLink
|
|
352
352
|
)}
|
|
353
|
-
href={`${basePath}/${viewPaths[(view === "SIGN_IN" || view === "MAGIC_LINK" || view === "EMAIL_OTP") ? "SIGN_UP" : "SIGN_IN"]}${
|
|
354
|
-
|
|
355
|
-
}`}
|
|
353
|
+
href={`${basePath}/${viewPaths[(view === "SIGN_IN" || view === "MAGIC_LINK" || view === "EMAIL_OTP") ? "SIGN_UP" : "SIGN_IN"]}${isHydrated ? window.location.search : ""
|
|
354
|
+
}`}
|
|
356
355
|
>
|
|
357
356
|
<Button
|
|
358
357
|
variant="link"
|
|
@@ -363,8 +362,8 @@ export function AuthView({
|
|
|
363
362
|
)}
|
|
364
363
|
>
|
|
365
364
|
{view === "SIGN_IN" ||
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
view === "MAGIC_LINK" ||
|
|
366
|
+
view === "EMAIL_OTP"
|
|
368
367
|
? localization.SIGN_UP
|
|
369
368
|
: localization.SIGN_IN}
|
|
370
369
|
</Button>
|
|
@@ -87,7 +87,7 @@ export function OrganizationLogoCard({
|
|
|
87
87
|
</div>
|
|
88
88
|
|
|
89
89
|
<SettingsCardFooter
|
|
90
|
-
className="
|
|
90
|
+
className="py-5!"
|
|
91
91
|
instructions={localization.LOGO_INSTRUCTIONS}
|
|
92
92
|
classNames={classNames}
|
|
93
93
|
isPending
|
|
@@ -297,7 +297,7 @@ function OrganizationLogoForm({
|
|
|
297
297
|
</div>
|
|
298
298
|
|
|
299
299
|
<SettingsCardFooter
|
|
300
|
-
className="
|
|
300
|
+
className="py-5!"
|
|
301
301
|
instructions={localization.LOGO_INSTRUCTIONS}
|
|
302
302
|
classNames={classNames}
|
|
303
303
|
isPending={isPending}
|
|
@@ -262,10 +262,10 @@ export function OrganizationSwitcher({
|
|
|
262
262
|
{...props}
|
|
263
263
|
>
|
|
264
264
|
{isPending ||
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
activeOrganization ||
|
|
266
|
+
!sessionData ||
|
|
267
|
+
(user as User)?.isAnonymous ||
|
|
268
|
+
hidePersonal ? (
|
|
269
269
|
<OrganizationLogo
|
|
270
270
|
key={activeOrganization?.logo}
|
|
271
271
|
className={cn(
|
|
@@ -295,7 +295,7 @@ export function OrganizationSwitcher({
|
|
|
295
295
|
) : (
|
|
296
296
|
<Button
|
|
297
297
|
className={cn(
|
|
298
|
-
"
|
|
298
|
+
"p-2! h-fit",
|
|
299
299
|
className,
|
|
300
300
|
classNames?.trigger?.base
|
|
301
301
|
)}
|
|
@@ -303,10 +303,10 @@ export function OrganizationSwitcher({
|
|
|
303
303
|
{...props}
|
|
304
304
|
>
|
|
305
305
|
{isPending ||
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
306
|
+
activeOrganization ||
|
|
307
|
+
!sessionData ||
|
|
308
|
+
(user as User)?.isAnonymous ||
|
|
309
|
+
hidePersonal ? (
|
|
310
310
|
<OrganizationCellView
|
|
311
311
|
classNames={
|
|
312
312
|
classNames?.trigger?.organization
|
|
@@ -350,8 +350,8 @@ export function OrganizationSwitcher({
|
|
|
350
350
|
{(user && !(user as User).isAnonymous) || isPending ? (
|
|
351
351
|
<>
|
|
352
352
|
{activeOrganizationPending ||
|
|
353
|
-
|
|
354
|
-
|
|
353
|
+
activeOrganization ||
|
|
354
|
+
hidePersonal ? (
|
|
355
355
|
<OrganizationCellView
|
|
356
356
|
classNames={
|
|
357
357
|
classNames?.content?.organization
|
|
@@ -385,7 +385,7 @@ export function OrganizationSwitcher({
|
|
|
385
385
|
<Button
|
|
386
386
|
size="icon"
|
|
387
387
|
variant="outline"
|
|
388
|
-
className="
|
|
388
|
+
className="size-8! ml-auto"
|
|
389
389
|
onClick={() =>
|
|
390
390
|
setDropdownOpen(false)
|
|
391
391
|
}
|
|
@@ -480,8 +480,8 @@ export function OrganizationSwitcher({
|
|
|
480
480
|
)}
|
|
481
481
|
|
|
482
482
|
{!isPending &&
|
|
483
|
-
|
|
484
|
-
|
|
483
|
+
sessionData &&
|
|
484
|
+
!(user as User).isAnonymous ? (
|
|
485
485
|
<DropdownMenuItem
|
|
486
486
|
className={cn(classNames?.content?.menuItem)}
|
|
487
487
|
onClick={() => setIsCreateOrgDialogOpen(true)}
|