fix: Use base URL from settings for dynamic client registration and metadata endpoints (#438)

This commit is contained in:
samanhappy
2025-11-21 16:20:54 +08:00
committed by GitHub
parent 449e6ea4fd
commit 01bb011736
2 changed files with 23 additions and 13 deletions

View File

@@ -449,7 +449,8 @@ export const getMetadata = async (req: Request, res: Response): Promise<void> =>
return;
}
const baseUrl = `${req.protocol}://${req.get('host')}`;
const baseUrl =
settings.systemConfig?.install?.baseUrl || `${req.protocol}://${req.get('host')}`;
const allowedScopes = oauthConfig.allowedScopes || ['read', 'write'];
const metadata: any = {
@@ -494,7 +495,8 @@ export const getProtectedResourceMetadata = async (req: Request, res: Response):
return;
}
const baseUrl = `${req.protocol}://${req.get('host')}`;
const baseUrl =
settings.systemConfig?.install?.baseUrl || `${req.protocol}://${req.get('host')}`;
const allowedScopes = oauthConfig.allowedScopes || ['read', 'write'];
// Return protected resource metadata according to RFC 9728