mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-26 23:06:37 +00:00
Badger & traefik working now?
This commit is contained in:
@@ -140,7 +140,7 @@ export async function verifyResourceSession(
|
||||
const result = await getResourceByDomain(cleanHost);
|
||||
|
||||
if (!result) {
|
||||
logger.debug("Resource not found", cleanHost);
|
||||
logger.debug(`Resource not found ${cleanHost}`);
|
||||
return notAllowed(res);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ export async function verifyResourceSession(
|
||||
const { resource, pincode, password } = resourceData;
|
||||
|
||||
if (!resource) {
|
||||
logger.debug("Resource not found", cleanHost);
|
||||
logger.debug(`Resource not found ${cleanHost}`);
|
||||
return notAllowed(res);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,13 @@ export async function verifyResourceSession(
|
||||
return allowed(res);
|
||||
}
|
||||
|
||||
const redirectUrl = `${config.getRawConfig().app.dashboard_url}/auth/resource/${encodeURIComponent(
|
||||
let endpoint: string;
|
||||
if (config.isHybridMode()) {
|
||||
endpoint = config.getRawConfig().hybrid?.redirect_endpoint || config.getRawConfig().hybrid?.endpoint || "";
|
||||
} else {
|
||||
endpoint = config.getRawConfig().app.dashboard_url;
|
||||
}
|
||||
const redirectUrl = `${endpoint}/auth/resource/${encodeURIComponent(
|
||||
resource.resourceId
|
||||
)}?redirect=${encodeURIComponent(originalRequestURL)}`;
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ badgerRouter.post("/verify-session", badger.verifyResourceSession);
|
||||
|
||||
if (config.isHybridMode()) {
|
||||
badgerRouter.post("/exchange-session", (req, res, next) =>
|
||||
proxyToRemote(req, res, next, "badger/exchange-session")
|
||||
proxyToRemote(req, res, next, "hybrid/badger/exchange-session")
|
||||
);
|
||||
} else {
|
||||
badgerRouter.post("/exchange-session", badger.exchangeSession);
|
||||
|
||||
@@ -51,7 +51,7 @@ export async function traefikConfigProvider(
|
||||
plugin: {
|
||||
[badgerMiddlewareName]: {
|
||||
apiBaseUrl: new URL(
|
||||
"/api/v0",
|
||||
"/api/v1",
|
||||
`http://${
|
||||
config.getRawConfig().server.internal_hostname
|
||||
}:${config.getRawConfig().server.internal_port}`
|
||||
|
||||
Reference in New Issue
Block a user