mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:41:09 +02:00
fix(auth): correct JWKS route mapping for OIDC
JWKS is at /api/auth/jwks, not /api/auth/oauth2/jwks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f6382ead87
commit
bea066c7f8
1 changed files with 5 additions and 1 deletions
|
|
@ -1201,7 +1201,7 @@ export class BetterAuthService {
|
|||
* - /api/oidc/authorize → /api/auth/oauth2/authorize
|
||||
* - /api/oidc/token → /api/auth/oauth2/token
|
||||
* - /api/oidc/userinfo → /api/auth/oauth2/userinfo
|
||||
* - /api/oidc/jwks → /api/auth/oauth2/jwks
|
||||
* - /api/oidc/jwks → /api/auth/jwks (JWKS is at basePath, not oauth2)
|
||||
*
|
||||
* @param req - Express request
|
||||
* @returns Response data from Better Auth
|
||||
|
|
@ -1220,6 +1220,10 @@ export class BetterAuthService {
|
|||
if (mappedPath.startsWith('/.well-known/')) {
|
||||
mappedPath = `/api/auth${mappedPath}`;
|
||||
}
|
||||
// Map /api/oidc/jwks to /api/auth/jwks (JWKS is not under oauth2)
|
||||
else if (mappedPath.startsWith('/api/oidc/jwks')) {
|
||||
mappedPath = mappedPath.replace('/api/oidc/jwks', '/api/auth/jwks');
|
||||
}
|
||||
// Map /api/oidc/* to /api/auth/oauth2/*
|
||||
else if (mappedPath.startsWith('/api/oidc/')) {
|
||||
mappedPath = mappedPath.replace('/api/oidc/', '/api/auth/oauth2/');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue