@jskit-ai/auth-core 0.2.11 → 0.2.12

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/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - `AuthProfileProjector.syncIdentityProfile` documents `onlyWhenChanged`, which providers pass on an ordinary request so a profile that already matches is only read; sign-in and session refresh synchronize in full.
5
6
  - `normalizeAuthCapabilities` carries `features.password.selfRegister`: whether anyone may register, not only an invited person or the first account. A provider that doesn't say gets the value of `register`.
6
7
  - The register body takes `setupCode`, the first account's one-time setup code, and the capability `features.firstAccountSetupCode` says a provider is waiting for it. New message key: `jskit.auth.validation.setupCodeInvalid`.
7
8
  - Registration confirmation: the action and command `auth.register.confirm` (`POST /api/register/confirm`, body `{ token }`, answer `{ ok, email, username, message }` with a message code) confirm a registration's email from the code in its link, and `authApi.confirmRegistration()` calls it. `AuthService.confirmRegistration(input)` creates the waiting account and its session; a provider without it answers `AUTH_OPERATION_UNSUPPORTED`. The capability `features.emailConfirmationCode` says the provider takes a code that way. The register and resend answers may carry `confirmationUrl`, the link itself in development. New message keys: `jskit.auth.login.emailUnconfirmed` (refused sign-in, status 403) and `jskit.auth.validation.confirmationCodeRequired`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/auth-core",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "jskit test"
@@ -143,6 +143,6 @@
143
143
  }
144
144
  },
145
145
  "peerDependencies": {
146
- "@jskit-ai/kernel": "0.2.11"
146
+ "@jskit-ai/kernel": "0.2.12"
147
147
  }
148
148
  }
@@ -24,9 +24,12 @@
24
24
  * identities that sign in. An auth provider without one uses noAppProfiles
25
25
  * (`@jskit-ai/auth-core/server/noAppProfiles`), which keeps none.
26
26
  * @typedef {object} AuthProfileProjector
27
- * @property {(profile: object, options?: object) => Promise<object | null>} syncIdentityProfile
27
+ * @property {(profile: object, options?: { onlyWhenChanged?: boolean }) => Promise<object | null>} syncIdentityProfile
28
28
  * Creates or updates the application's profile of a signed-in identity and answers it,
29
- * or null when the application keeps no profiles.
29
+ * or null when the application keeps no profiles. Providers synchronize in full at sign-in and
30
+ * at each session refresh; an ordinary request passes `onlyWhenChanged`, which answers an
31
+ * existing profile that already matches the identity after one read and synchronizes only a
32
+ * missing or changed one.
30
33
  * @property {(identity: object, options?: object) => Promise<object | null>} findByIdentity
31
34
  * Answers the existing profile without synchronizing it, or null when there is none.
32
35
  */