@authowl/react 0.18.2 → 0.18.4
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 +16 -8
- package/dist/index.js +16 -8
- package/dist/styles.css +11 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -625,14 +625,18 @@ var KNOWN_METHODS = [
|
|
|
625
625
|
function emailAutocomplete(isPasskeyHost) {
|
|
626
626
|
return isPasskeyHost ? "email webauthn" : "email";
|
|
627
627
|
}
|
|
628
|
-
function passkeyReachableFrom(authBaseUrl, pageHost) {
|
|
629
|
-
if (pageHost === void 0
|
|
630
|
-
let rpId;
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
628
|
+
function passkeyReachableFrom(authBaseUrl, pageHost, relyingPartyId) {
|
|
629
|
+
if (pageHost === void 0) return true;
|
|
630
|
+
let rpId = relyingPartyId ?? void 0;
|
|
631
|
+
if (!rpId) {
|
|
632
|
+
if (!authBaseUrl) return true;
|
|
633
|
+
try {
|
|
634
|
+
rpId = new URL(authBaseUrl).hostname;
|
|
635
|
+
} catch {
|
|
636
|
+
return true;
|
|
637
|
+
}
|
|
635
638
|
}
|
|
639
|
+
if (rpId !== "localhost" && !rpId.includes(".")) return false;
|
|
636
640
|
return pageHost === rpId || pageHost.endsWith(`.${rpId}`);
|
|
637
641
|
}
|
|
638
642
|
function resolveSignInMethods(config, pageHost) {
|
|
@@ -645,7 +649,11 @@ function resolveSignInMethods(config, pageHost) {
|
|
|
645
649
|
const magicLink = capabilities.magicLinkSignIn;
|
|
646
650
|
const emailOtp = capabilities.emailOtpSignIn && !capabilities.totp && !capabilities.mfaRequired;
|
|
647
651
|
const phoneOtp = capabilities.phoneSignIn;
|
|
648
|
-
const passkey = capabilities.passkeySignIn && passkeyReachableFrom(
|
|
652
|
+
const passkey = capabilities.passkeySignIn && passkeyReachableFrom(
|
|
653
|
+
config?.authBaseUrl,
|
|
654
|
+
pageHost,
|
|
655
|
+
config?.authentication?.passkey?.relyingPartyId
|
|
656
|
+
);
|
|
649
657
|
const sso = has("sso");
|
|
650
658
|
const renderable = password || username || magicLink || emailOtp || phoneOtp || passkey || sso || social.length > 0;
|
|
651
659
|
const emptyReason = renderable ? null : methods.length > 0 ? "unsupported" : "none";
|
package/dist/index.js
CHANGED
|
@@ -544,14 +544,18 @@ var KNOWN_METHODS = [
|
|
|
544
544
|
function emailAutocomplete(isPasskeyHost) {
|
|
545
545
|
return isPasskeyHost ? "email webauthn" : "email";
|
|
546
546
|
}
|
|
547
|
-
function passkeyReachableFrom(authBaseUrl, pageHost) {
|
|
548
|
-
if (pageHost === void 0
|
|
549
|
-
let rpId;
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
547
|
+
function passkeyReachableFrom(authBaseUrl, pageHost, relyingPartyId) {
|
|
548
|
+
if (pageHost === void 0) return true;
|
|
549
|
+
let rpId = relyingPartyId ?? void 0;
|
|
550
|
+
if (!rpId) {
|
|
551
|
+
if (!authBaseUrl) return true;
|
|
552
|
+
try {
|
|
553
|
+
rpId = new URL(authBaseUrl).hostname;
|
|
554
|
+
} catch {
|
|
555
|
+
return true;
|
|
556
|
+
}
|
|
554
557
|
}
|
|
558
|
+
if (rpId !== "localhost" && !rpId.includes(".")) return false;
|
|
555
559
|
return pageHost === rpId || pageHost.endsWith(`.${rpId}`);
|
|
556
560
|
}
|
|
557
561
|
function resolveSignInMethods(config, pageHost) {
|
|
@@ -564,7 +568,11 @@ function resolveSignInMethods(config, pageHost) {
|
|
|
564
568
|
const magicLink = capabilities.magicLinkSignIn;
|
|
565
569
|
const emailOtp = capabilities.emailOtpSignIn && !capabilities.totp && !capabilities.mfaRequired;
|
|
566
570
|
const phoneOtp = capabilities.phoneSignIn;
|
|
567
|
-
const passkey = capabilities.passkeySignIn && passkeyReachableFrom(
|
|
571
|
+
const passkey = capabilities.passkeySignIn && passkeyReachableFrom(
|
|
572
|
+
config?.authBaseUrl,
|
|
573
|
+
pageHost,
|
|
574
|
+
config?.authentication?.passkey?.relyingPartyId
|
|
575
|
+
);
|
|
568
576
|
const sso = has("sso");
|
|
569
577
|
const renderable = password || username || magicLink || emailOtp || phoneOtp || passkey || sso || social.length > 0;
|
|
570
578
|
const emptyReason = renderable ? null : methods.length > 0 ? "unsupported" : "none";
|
package/dist/styles.css
CHANGED
|
@@ -200,7 +200,13 @@
|
|
|
200
200
|
.ba-profile-heading, .ba-profile-modal-header { padding: 24px 28px; border-bottom: 1px solid var(--ba-divider); }
|
|
201
201
|
.ba-profile-heading h1, .ba-profile-modal-header h1 { margin: 0; font-size: 22px; line-height: 1.25; }
|
|
202
202
|
.ba-profile-heading p, .ba-profile-modal-header p { margin: 6px 0 0; color: var(--ba-muted); }
|
|
203
|
-
|
|
203
|
+
/* No min-height. A grid row already sizes to its tallest column, which here is
|
|
204
|
+
the nav, so the panel is exactly as tall as it needs to be. The 460px floor it
|
|
205
|
+
replaces was there to stop the modal resizing between tabs, but the shortest
|
|
206
|
+
tab - Profile, an avatar field and a button - is the one most people open
|
|
207
|
+
first, and it left roughly 200px of empty white below the content, reading as
|
|
208
|
+
a broken panel rather than a stable one. */
|
|
209
|
+
.ba-profile-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
|
|
204
210
|
.ba-profile-nav { display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; border-inline-end: 1px solid var(--ba-divider); background: color-mix(in srgb, var(--ba-hover) 55%, var(--ba-surface)); }
|
|
205
211
|
.ba-profile-nav-item { width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ba-muted); cursor: pointer; font: inherit; font-weight: 500; text-align: start; }
|
|
206
212
|
.ba-profile-nav-item:hover { color: var(--ba-fg); background: var(--ba-hover); }
|
|
@@ -312,7 +318,8 @@
|
|
|
312
318
|
.ba-organization-profile-heading { display: flex; align-items: center; gap: 13px; padding: 22px 26px; border-bottom: 1px solid var(--ba-divider); }
|
|
313
319
|
.ba-organization-profile-heading h2, .ba-organization-profile-heading p { margin: 0; }
|
|
314
320
|
.ba-organization-profile-heading p { margin-top: 4px; }
|
|
315
|
-
.ba-
|
|
321
|
+
/* Same reasoning as .ba-profile-layout: the nav column sets the height. */
|
|
322
|
+
.ba-organization-profile-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: start; }
|
|
316
323
|
.ba-organization-profile-nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 10px; border-inline-end: 1px solid var(--ba-divider); background: color-mix(in srgb, var(--ba-hover) 55%, var(--ba-surface)); }
|
|
317
324
|
.ba-organization-profile-content { min-width: 0; padding: 26px; }
|
|
318
325
|
.ba-organization-section { max-width: 610px; }
|
|
@@ -331,7 +338,7 @@
|
|
|
331
338
|
.ba-profile-overlay { align-items: end; padding: 0; }
|
|
332
339
|
.ba-profile-modal { width: 100%; max-height: 94dvh; border-radius: 16px 16px 0 0; border-bottom: 0; }
|
|
333
340
|
.ba-profile-heading, .ba-profile-modal-header { padding: 20px; }
|
|
334
|
-
.ba-profile-layout { display: block;
|
|
341
|
+
.ba-profile-layout { display: block; }
|
|
335
342
|
.ba-profile-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 14px; border-inline-end: 0; border-bottom: 1px solid var(--ba-divider); }
|
|
336
343
|
.ba-profile-nav-item { width: 100%; min-width: 0; }
|
|
337
344
|
.ba-profile-content { padding: 22px 20px 28px; }
|
|
@@ -344,7 +351,7 @@
|
|
|
344
351
|
.ba-organization-directory { border-radius: 0; }
|
|
345
352
|
.ba-organization-directory-header { flex-direction: column; }
|
|
346
353
|
.ba-organization-card-grid { grid-template-columns: 1fr; }
|
|
347
|
-
.ba-organization-profile-layout { display: block;
|
|
354
|
+
.ba-organization-profile-layout { display: block; }
|
|
348
355
|
.ba-organization-profile-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 14px; border-inline-end: 0; border-bottom: 1px solid var(--ba-divider); }
|
|
349
356
|
.ba-organization-profile-content { padding: 20px; }
|
|
350
357
|
.ba-organization-member { align-items: flex-start; flex-wrap: wrap; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authowl/react",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "React provider, hooks, and drop-in components for AuthOwl, the multi-tenant auth SaaS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"LICENSE"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@authowl/core": "0.15.
|
|
50
|
+
"@authowl/core": "0.15.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": ">=18",
|