@enterprisestandard/react 0.0.3-beta.20251029.3 → 0.0.3-beta.20251106.1

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.js CHANGED
@@ -148,6 +148,7 @@ function sso(config) {
148
148
  const expiresIn = Number(token.refresh_expires_in ?? token.expires_in ?? 3600);
149
149
  const expires = token.expires ? new Date(token.expires) : new Date(Date.now() + expiresIn * 1000);
150
150
  return {
151
+ id: idToken.sub,
151
152
  userName: idToken.preferred_username || "",
152
153
  name: idToken.name || "",
153
154
  email: idToken.email || "",
@@ -391,7 +392,7 @@ function sso(config) {
391
392
  return JSON.parse(str);
392
393
  }
393
394
  async function handler(request, handlerConfig) {
394
- let { loginUrl, userUrl, errorUrl, landingUrl, tokenUrl, refreshUrl } = handlerConfig ?? {};
395
+ let { loginUrl, userUrl, errorUrl, landingUrl, tokenUrl, refreshUrl, jwksUrl } = handlerConfig ?? {};
395
396
  if (!loginUrl)
396
397
  loginUrl = "*";
397
398
  const path = new URL(request.url).pathname;
@@ -433,6 +434,12 @@ function sso(config) {
433
434
  headers: refreshHeaders
434
435
  });
435
436
  }
437
+ if (jwksUrl === path) {
438
+ const jwks = await fetchJwks();
439
+ return new Response(JSON.stringify(jwks), {
440
+ headers: [["Content-Type", "application/json"]]
441
+ });
442
+ }
436
443
  if (loginUrl === "*" || loginUrl === path) {
437
444
  return initiateLogin({
438
445
  landingUrl: landingUrl || "/",
package/dist/sso.d.ts CHANGED
@@ -29,6 +29,7 @@ export type SSOHandlerConfig = {
29
29
  landingUrl?: string;
30
30
  tokenUrl?: string;
31
31
  refreshUrl?: string;
32
+ jwksUrl?: string;
32
33
  } & ESConfig;
33
34
  export type SSO = {
34
35
  getUser: (request: Request) => Promise<EnterpriseUser | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enterprisestandard/react",
3
- "version": "0.0.3-beta.20251029.3",
3
+ "version": "0.0.3-beta.20251106.1",
4
4
  "description": "Enterprise Standard React Components",
5
5
  "private": false,
6
6
  "main": "dist/index.js",