fix(GRO-424): move reinitAuth to active router, add SSRF timeout, fix trailing slash
- Add reinitAuth() import and calls to routes/authProvider.ts (active router) instead of routes/admin/authProvider.ts (dead code, not imported) - Add AbortSignal.timeout(10_000) to fetch in setup auth-provider/test endpoint - Add .replace(/\/$/, "") to strip trailing slash from internalBaseUrl - Delete dead routes/admin/authProvider.ts Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -210,11 +210,11 @@ setupRouter.post("/auth-provider/test", async (c) => {
|
||||
|
||||
// Determine the discovery URL
|
||||
const discoveryUrl = body.internalBaseUrl
|
||||
? `${body.internalBaseUrl}/application/o/.well-known/openid-configuration`
|
||||
? `${body.internalBaseUrl.replace(/\/$/, "")}/application/o/.well-known/openid-configuration`
|
||||
: `${body.issuerUrl}/.well-known/openid-configuration`;
|
||||
|
||||
try {
|
||||
const res = await fetch(discoveryUrl, { method: "GET" });
|
||||
const res = await fetch(discoveryUrl, { method: "GET", signal: AbortSignal.timeout(10_000) });
|
||||
if (!res.ok) {
|
||||
return c.json({
|
||||
ok: false,
|
||||
|
||||
Reference in New Issue
Block a user