diff --git a/server/src/endpoints/session.ts b/server/src/endpoints/session.ts index a6bf445..e56d95c 100644 --- a/server/src/endpoints/session.ts +++ b/server/src/endpoints/session.ts @@ -6,14 +6,12 @@ export default class SessionRequestHandler extends RequestHandler { async handler(req: express.Request, res: express.Response) { const request = req as any; - const authenticated = !!(request.oidc?.user?.sub || request.session?.passport?.user?.id); - const availableServiceNames = Object.keys(config.services || {}) .filter(key => { const serviceConfig = (config.services as any)?.[key]; const apiKey = serviceConfig?.apiKey; const loginRequired = serviceConfig?.loginRequired ?? true; - return apiKey && (!loginRequired || authenticated); + return apiKey && (!loginRequired || this.userID); }); if (request.oidc) {