Skip to content

Commit ba100f8

Browse files
Address Copilot review on JavaScriptSolidServer#287
1. Move the orphaned /** Registration page HTML */ docblock back above registerPage where it belongs — it had been pushed off its function when the new landingPage was inserted ahead of it. 2. /idp/auth no-client_id guard now triggers only when the parameter is truly absent (=== undefined), not when it's present-but-empty. An explicit ?client_id= is a malformed OIDC request and oidc-provider should be the one to surface the spec error, not us silently redirecting to the friendly landing.
1 parent cc68744 commit ba100f8

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/idp/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ export async function idpPlugin(fastify, options) {
159159
method: ['GET', 'POST', 'DELETE', 'OPTIONS'],
160160
url: '/idp/auth',
161161
handler: async (request, reply) => {
162-
if (request.method === 'GET' && !request.query?.client_id) {
162+
// Only catch the truly-bare case (no `client_id` param at all). An
163+
// explicit empty string is a malformed OIDC request — let
164+
// oidc-provider surface the spec error instead of redirecting.
165+
if (request.method === 'GET' && request.query?.client_id === undefined) {
163166
return reply.redirect('/idp');
164167
}
165168
return forwardToProvider(request, reply);

src/idp/views.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,6 @@ export function errorPage(title, message) {
550550
`;
551551
}
552552

553-
/**
554-
* Registration page HTML
555-
*/
556553
/**
557554
* Friendly landing page for the IdP root.
558555
*
@@ -624,6 +621,9 @@ export function landingPage(ctx = {}) {
624621
`;
625622
}
626623

624+
/**
625+
* Registration page HTML
626+
*/
627627
export function registerPage(uid = null, error = null, success = null, inviteOnly = false, ctx = {}) {
628628
const inviteField = inviteOnly ? `
629629
<label for="invite">Invite Code</label>

0 commit comments

Comments
 (0)