@jskit-ai/auth-core 0.2.16 → 0.2.18

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
+ - The `AuthInvitationContextResolver` type documents what local auth relies on: the resolver throws for an invitation the registration cannot use, and the context it answers names, in `email`, the address the invitation was sent to and, in `expiresAt`, when it stops working, so a registration through it can skip email confirmation.
5
6
  - `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.
6
7
  - `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`.
7
8
  - 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`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/auth-core",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "jskit test"
@@ -65,7 +65,7 @@
65
65
  "dependencies": {
66
66
  "@fastify/cookie": "^11.1.2",
67
67
  "@fastify/csrf-protection": "^8.0.1",
68
- "json-rest-schema": "^1.0.17"
68
+ "json-rest-schema": "^1.0.20"
69
69
  },
70
70
  "jskit": {
71
71
  "kind": "runtime",
@@ -143,6 +143,6 @@
143
143
  }
144
144
  },
145
145
  "peerDependencies": {
146
- "@jskit-ai/kernel": "0.2.16"
146
+ "@jskit-ai/kernel": "0.2.18"
147
147
  }
148
148
  }
@@ -38,7 +38,12 @@
38
38
  * The invitation context resolver an application registers on
39
39
  * `auth.extensions`; an auth provider reads it once with
40
40
  * resolveInvitationContextResolver(), which answers invitationAsGiven when none
41
- * is registered.
41
+ * is registered. It throws for an invitation the registration cannot use
42
+ * (unknown, no longer pending, or sent to another email), and the context it
43
+ * answers becomes the provider's profile options' `invitation`. The context's
44
+ * `email`, when given, is the address the invitation was sent to, and its
45
+ * `expiresAt` when the invitation stops working: local auth registers a person
46
+ * whose email the invitation names, before then, without confirming the email.
42
47
  * @typedef {object} AuthInvitationContextResolver
43
48
  * @property {string} resolverId
44
49
  * @property {(invitation: { token: string, source: string, email: string }) => Promise<object>} resolveInvitationContext