fix(auth): expose JWKS at /api/auth/jwks for OIDC discovery

Better Auth's discovery document points to /api/auth/jwks,
so we need to expose this route directly in NestJS.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-01-29 12:21:39 +01:00
parent 2021cf9e22
commit e46a4c96df

View file

@ -61,7 +61,7 @@ export class OidcController {
}
/**
* JWKS Endpoint
* JWKS Endpoint (via /api/oidc/jwks)
*
* Returns JSON Web Key Set for token verification.
*/
@ -70,6 +70,17 @@ export class OidcController {
return this.handleOidcRequest(req, res);
}
/**
* JWKS Endpoint (via /api/auth/jwks)
*
* Better Auth's discovery document points to this path,
* so we need to expose it directly as well.
*/
@Get('api/auth/jwks')
async jwksAlt(@Req() req: Request, @Res() res: Response) {
return this.handleOidcRequest(req, res);
}
/**
* Catch-all for other OIDC endpoints
*/