javascript-solid-server 0.0.24 → 0.0.25
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/package.json +1 -1
- package/src/idp/provider.js +11 -0
package/package.json
CHANGED
package/src/idp/provider.js
CHANGED
|
@@ -276,6 +276,17 @@ export async function createProvider(issuer) {
|
|
|
276
276
|
// Clock tolerance for token validation
|
|
277
277
|
clockTolerance: 60, // 60 seconds
|
|
278
278
|
|
|
279
|
+
// Allow CORS for public clients from any origin
|
|
280
|
+
// This is needed for web apps like Mashlib loaded from CDN
|
|
281
|
+
clientBasedCORS: (ctx, origin, client) => {
|
|
282
|
+
// Allow all origins for public clients (no client_secret)
|
|
283
|
+
if (client.tokenEndpointAuthMethod === 'none') {
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
// For confidential clients, check registered origins
|
|
287
|
+
return false;
|
|
288
|
+
},
|
|
289
|
+
|
|
279
290
|
// Render errors
|
|
280
291
|
renderError: async (ctx, out, error) => {
|
|
281
292
|
ctx.type = 'html';
|