@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 +8 -1
- package/dist/sso.d.ts +1 -0
- package/package.json +1 -1
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