@authowl/react 0.18.3 → 0.18.5

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 CHANGED
@@ -3211,7 +3211,7 @@ function MFAEnrollment({ onEnrolled, title }) {
3211
3211
 
3212
3212
  // src/components/mfa-enrollment-step.tsx
3213
3213
  var import_jsx_runtime15 = require("react/jsx-runtime");
3214
- function useConfirmedMfaPending() {
3214
+ function useConfirmedMfaPending(onUnknown = "pending") {
3215
3215
  const client = useAuthClient();
3216
3216
  const { needsMfaEnrollment } = useUser();
3217
3217
  const { refetch } = useSession();
@@ -3224,16 +3224,16 @@ function useConfirmedMfaPending() {
3224
3224
  let active = true;
3225
3225
  client.getSession({ query: { disableCookieCache: true } }).then((res) => {
3226
3226
  if (!active) return;
3227
- const pending = res.error ? true : res.data?.session?.pendingMfaEnrollment === true;
3227
+ const pending = res.error ? onUnknown === "pending" : res.data?.session?.pendingMfaEnrollment === true;
3228
3228
  setConfirmed(pending);
3229
3229
  if (!pending && !res.error) refetch({ query: { disableCookieCache: true } });
3230
3230
  }).catch(() => {
3231
- if (active) setConfirmed(true);
3231
+ if (active) setConfirmed(onUnknown === "pending");
3232
3232
  });
3233
3233
  return () => {
3234
3234
  active = false;
3235
3235
  };
3236
- }, [client, needsMfaEnrollment, refetch]);
3236
+ }, [client, needsMfaEnrollment, refetch, onUnknown]);
3237
3237
  if (!needsMfaEnrollment) return "clear";
3238
3238
  return confirmed === true ? "pending" : "confirming";
3239
3239
  }
@@ -3645,7 +3645,7 @@ function SignIn({
3645
3645
  );
3646
3646
  const [inFlight, setInFlight] = React16.useState(null);
3647
3647
  const [challenge, setChallenge] = React16.useState(false);
3648
- const mfaEnrolment = useConfirmedMfaPending();
3648
+ const mfaEnrolment = useConfirmedMfaPending("clear");
3649
3649
  const emailRef = React16.useRef(null);
3650
3650
  const plan = resolveSignInMethods(
3651
3651
  config,
package/dist/index.js CHANGED
@@ -3130,7 +3130,7 @@ function MFAEnrollment({ onEnrolled, title }) {
3130
3130
 
3131
3131
  // src/components/mfa-enrollment-step.tsx
3132
3132
  import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
3133
- function useConfirmedMfaPending() {
3133
+ function useConfirmedMfaPending(onUnknown = "pending") {
3134
3134
  const client = useAuthClient();
3135
3135
  const { needsMfaEnrollment } = useUser();
3136
3136
  const { refetch } = useSession();
@@ -3143,16 +3143,16 @@ function useConfirmedMfaPending() {
3143
3143
  let active = true;
3144
3144
  client.getSession({ query: { disableCookieCache: true } }).then((res) => {
3145
3145
  if (!active) return;
3146
- const pending = res.error ? true : res.data?.session?.pendingMfaEnrollment === true;
3146
+ const pending = res.error ? onUnknown === "pending" : res.data?.session?.pendingMfaEnrollment === true;
3147
3147
  setConfirmed(pending);
3148
3148
  if (!pending && !res.error) refetch({ query: { disableCookieCache: true } });
3149
3149
  }).catch(() => {
3150
- if (active) setConfirmed(true);
3150
+ if (active) setConfirmed(onUnknown === "pending");
3151
3151
  });
3152
3152
  return () => {
3153
3153
  active = false;
3154
3154
  };
3155
- }, [client, needsMfaEnrollment, refetch]);
3155
+ }, [client, needsMfaEnrollment, refetch, onUnknown]);
3156
3156
  if (!needsMfaEnrollment) return "clear";
3157
3157
  return confirmed === true ? "pending" : "confirming";
3158
3158
  }
@@ -3567,7 +3567,7 @@ function SignIn({
3567
3567
  );
3568
3568
  const [inFlight, setInFlight] = React16.useState(null);
3569
3569
  const [challenge, setChallenge] = React16.useState(false);
3570
- const mfaEnrolment = useConfirmedMfaPending();
3570
+ const mfaEnrolment = useConfirmedMfaPending("clear");
3571
3571
  const emailRef = React16.useRef(null);
3572
3572
  const plan = resolveSignInMethods(
3573
3573
  config,
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
- .ba-profile-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 460px; }
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-organization-profile-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 480px; }
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; min-height: 0; }
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; min-height: 0; }
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",
3
+ "version": "0.18.5",
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.1"
50
+ "@authowl/core": "0.15.2"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "react": ">=18",