@jskit-ai/auth-provider-oidc-core 0.2.18 → 0.2.20

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
+ - An ordinary request synchronizes the app profile only when it is missing or no longer matches the identity its session keeps from sign-in (`onlyWhenChanged`); sign-in synchronizes in full. The session is still read on every request. Visible difference: a personal workspace, owner membership or settings row deleted while someone is signed in comes back at their next sign-in instead of their next request.
5
6
  - `confirmRegistration` answers `AUTH_OPERATION_UNSUPPORTED`: the hub confirms emails itself.
6
7
 
7
8
  ## 0.2.0 - 2026-10-29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/auth-provider-oidc-core",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "jskit test"
@@ -20,8 +20,8 @@
20
20
  "openid-client": "6.8.8"
21
21
  },
22
22
  "devDependencies": {
23
- "@jskit-ai/auth-provider-local-core": "0.2.14",
24
- "@jskit-ai/auth-web": "0.2.16",
23
+ "@jskit-ai/auth-provider-local-core": "0.2.16",
24
+ "@jskit-ai/auth-web": "0.2.18",
25
25
  "oidc-provider": "9.12.2"
26
26
  },
27
27
  "description": "Sign in through any OpenID Connect issuer: self-registration or a static client, app-owned sessions, and back-channel logout.",
@@ -91,7 +91,7 @@
91
91
  }
92
92
  },
93
93
  "peerDependencies": {
94
- "@jskit-ai/auth-core": "0.2.11",
95
- "@jskit-ai/kernel": "0.2.11"
94
+ "@jskit-ai/auth-core": "0.2.13",
95
+ "@jskit-ai/kernel": "0.2.13"
96
96
  }
97
97
  }
@@ -2,7 +2,7 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@jskit-ai/auth-provider-oidc-core": "0.2.18",
6
- "@jskit-ai/auth-web": "0.2.16"
5
+ "@jskit-ai/auth-provider-oidc-core": "0.2.20",
6
+ "@jskit-ai/auth-web": "0.2.18"
7
7
  }
8
8
  }
@@ -115,9 +115,12 @@ function createOidcAuthService({ config, store, issuer, profileProjector, logger
115
115
  }
116
116
  });
117
117
 
118
- async function syncedResult(identity, { session = null } = {}) {
118
+ async function syncedResult(identity, { session = null, onlyWhenChanged = false } = {}) {
119
119
  if (!appProfileProjection) return buildResult(identity, { session });
120
- const appProfile = await profileProjector.syncIdentityProfile(buildProfile(identity));
120
+ const profile = buildProfile(identity);
121
+ const appProfile = await (onlyWhenChanged
122
+ ? profileProjector.syncIdentityProfile(profile, { onlyWhenChanged })
123
+ : profileProjector.syncIdentityProfile(profile));
121
124
  return buildResult(identity, { session, appProfile });
122
125
  }
123
126
 
@@ -276,7 +279,10 @@ function createOidcAuthService({ config, store, issuer, profileProjector, logger
276
279
 
277
280
  /**
278
281
  * A dev session, or a caller that asks only who is signed in (syncProfile:
279
- * false), reads the existing app profile instead of synchronizing it.
282
+ * false), reads the existing app profile instead of synchronizing it. Any
283
+ * other request synchronizes only a missing profile or one that no longer
284
+ * matches the identity the session keeps from its sign-in, which synchronized
285
+ * in full.
280
286
  */
281
287
  async function authenticateRequest(request, { syncProfile = true } = {}) {
282
288
  const session = await sessionFromRequest(request);
@@ -296,7 +302,7 @@ function createOidcAuthService({ config, store, issuer, profileProjector, logger
296
302
  if (appProfileProjection && !appProfile) return unauthenticated(true);
297
303
  result = buildResult(identity, { appProfile });
298
304
  } else {
299
- result = await syncedResult(identity);
305
+ result = await syncedResult(identity, { onlyWhenChanged: true });
300
306
  }
301
307
  return {
302
308
  authenticated: true,