diff --git a/.env.example b/.env.example index 73f7ea9..ce55860 100644 --- a/.env.example +++ b/.env.example @@ -32,8 +32,8 @@ AUTHENTICATION_NECESSARY_CONTRIBUTIONS=false AUTHENTICATION_NECESSARY_AI=false AUTHENTICATION_NECESSARY_GATEDCONTENT=true -# OIDC Provider Configuration -OIDC_ENDPOINT=https://your-nextcloud.com/index.php/apps/oidc +# OIDC Provider Configuration - Server appends endpoint (e.g. auth/callback) automatically +OIDC_ENDPOINT=https://cloud.cc24.dev/index.php OIDC_CLIENT_ID=your-client-id OIDC_CLIENT_SECRET=your-client-secret diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 6330d69..bfd51bf 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -229,6 +229,12 @@ const { title, description = 'ForensicPathways - A comprehensive directory of di authRequired: data.aiAuthRequired, expires: data.expires }; + case 'gatedcontent': // ADD THIS CASE + return { + authenticated: data.gatedContentAuthenticated, + authRequired: data.gatedContentAuthRequired, + expires: data.expires + }; default: return { authenticated: data.authenticated, diff --git a/src/pages/api/auth/process.ts b/src/pages/api/auth/process.ts index e7abed9..2afa73f 100644 --- a/src/pages/api/auth/process.ts +++ b/src/pages/api/auth/process.ts @@ -44,16 +44,12 @@ export const POST: APIRoute = async ({ request }) => { }); const responseHeaders = new Headers(); - responseHeaders.set('Content-Type', 'application/json'); - + responseHeaders.set('Location', stateVerification.stateData.returnTo); responseHeaders.append('Set-Cookie', sessionResult.sessionCookie); responseHeaders.append('Set-Cookie', sessionResult.clearStateCookie); - - return new Response(JSON.stringify({ - success: true, - redirectTo: stateVerification.stateData.returnTo - }), { - status: 200, + + return new Response(null, { + status: 302, headers: responseHeaders }); diff --git a/src/pages/knowledgebase.astro b/src/pages/knowledgebase.astro index 0889c8d..66284a0 100644 --- a/src/pages/knowledgebase.astro +++ b/src/pages/knowledgebase.astro @@ -174,7 +174,9 @@ const publicCount = knowledgebaseEntries.length - gatedCount;