@lumoauth/client 1.5.0 → 1.6.0

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.
Files changed (2) hide show
  1. package/README.md +21 -9
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -179,8 +179,10 @@ such as `document.edit`.
179
179
  ```ts
180
180
  const canEdit = await client.permissions.check('document.edit');
181
181
 
182
- // Optional context for policies that read request data
183
- const canEditThis = await client.permissions.check('document.edit', { document_id: 456 });
182
+ // Optional context for ABAC policies: `resource_id` selects the resource whose stored
183
+ // attributes the policies read. Other keys count only when they are the slug of an
184
+ // environment attribute that your organization defined; anything else is ignored.
185
+ const canEditThis = await client.permissions.check('document.edit', { resource_id: 'doc-456' });
184
186
 
185
187
  // Many permissions in one request
186
188
  const { results } = await client.permissions.checkBulk(['document.edit', 'document.delete']);
@@ -341,10 +343,11 @@ user straight to that social provider.
341
343
  These calls let you build your own sign-in screen.
342
344
 
343
345
  ```ts
344
- // Which sign-in methods can this person use?
345
- const found = await client.auth.checkEmailExists('ada@example.com');
346
- // found.exists, found.passwordEnabled, found.passkeyEnabled, found.magicLinkEnabled,
347
- // found.hasPasskey, found.hasPushDevice, found.maskedEmail, …
346
+ // Which sign-in methods does the organization offer?
347
+ const methods = await client.auth.checkEmailExists('ada@example.com');
348
+ // methods.passwordEnabled, methods.passkeyEnabled, methods.magicLinkEnabled
349
+ // methods.exists is true whenever the server answered. It does not say
350
+ // whether the address has an account.
348
351
 
349
352
  // Email a one-time sign-in link. The answer is { sent: true } whether or not
350
353
  // the account exists, so the response never reveals that.
@@ -360,8 +363,17 @@ if (result.status === 'complete') {
360
363
  }
361
364
  ```
362
365
 
363
- `checkEmailExists` never throws for a network failure or an unknown email. It returns an object
364
- in which every flag is `false`, so your screen can fall back to the hosted login page.
366
+ `checkEmailExists` names your application (`clientId`) and sends no cookie. From a browser, the
367
+ origin of your app must be one of the application's allowed origins. The answer holds the
368
+ sign-in methods of the organization and is the same for every address. A known address and a new
369
+ one cannot be told apart, so show the same next step to everyone. An unknown address fails at
370
+ that step in the same way as a wrong password. `hasPasskey` and `hasPushDevice` are always
371
+ `false`. Offer a passkey when `passkeyEnabled` is `true`.
372
+
373
+ `checkEmailExists` never throws. When the check is not available (a network failure, a rate
374
+ limit, or a refused request such as an origin that is not allowed), it returns an object in
375
+ which every flag is `false`, `exists` included. Your screen can then fall back to the hosted
376
+ login page.
365
377
 
366
378
  `requestMagicLink` names your application (`clientId`) and sends no cookie. From a browser, the
367
379
  origin of your app must be one of the application's allowed origins. The link opens a
@@ -711,7 +723,7 @@ Every request and response also has a Zod schema, exported with its type, such a
711
723
  | | `refreshToken(refreshToken)` | `TokenResponse` | `orgId`, `clientId` |
712
724
  | | `revokeToken(token, accessToken?)` | `void` | `orgId`, `clientId` |
713
725
  | | `getUserInfo(accessToken)` | `UserInfo` | `orgId` |
714
- | | `checkEmailExists(email)` | `EmailCheckResult` | `orgId` |
726
+ | | `checkEmailExists(email)` | `EmailCheckResult` | `orgId`, `clientId` |
715
727
  | | `requestMagicLink({ email, returnTo?, captchaToken? })` | `{ sent: true }` | `orgId`, `clientId` |
716
728
  | | `loginWithPassword({ email, password })` | `{ status, challengeUrl? }` | `orgId` |
717
729
  | | `passwordGrant(username, password, …)` | `TokenResponse` | older grant; the organization must allow it |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumoauth/client",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Official LumoAuth browser SDK — OAuth 2.0 PKCE, permissions, Zanzibar (ReBAC), and ABAC for any JavaScript/TypeScript application.",
5
5
  "license": "MIT",
6
6
  "author": "LumoAuth",
@@ -38,7 +38,7 @@
38
38
  "browser"
39
39
  ],
40
40
  "dependencies": {
41
- "@lumoauth/shared": "^1.5.0",
41
+ "@lumoauth/shared": "^1.6.0",
42
42
  "zod": "^4.6.7"
43
43
  },
44
44
  "devDependencies": {