mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-28 07:46:36 +00:00
allow resource redirect if host is same
This commit is contained in:
@@ -101,8 +101,7 @@ export async function verifyResourceSession(
|
|||||||
return allowed(res);
|
return allowed(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
// const redirectUrl = `${config.getRawConfig().app.dashboard_url}/auth/resource/${encodeURIComponent(resource.resourceId)}?redirect=${encodeURIComponent(originalRequestURL)}`;
|
const redirectUrl = `${config.getRawConfig().app.dashboard_url}/auth/resource/${encodeURIComponent(resource.resourceId)}?redirect=${encodeURIComponent(originalRequestURL)}`;
|
||||||
const redirectUrl = `${config.getRawConfig().app.dashboard_url}/auth/resource/${encodeURIComponent(resource.resourceId)}`;
|
|
||||||
|
|
||||||
if (!sessions) {
|
if (!sessions) {
|
||||||
return notAllowed(res);
|
return notAllowed(res);
|
||||||
|
|||||||
@@ -56,16 +56,16 @@ export default async function ResourceAuthPage(props: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let redirectUrl = authInfo.url;
|
let redirectUrl = authInfo.url;
|
||||||
// if (searchParams.redirect) {
|
if (searchParams.redirect) {
|
||||||
// try {
|
try {
|
||||||
// const serverResourceHost = new URL(authInfo.url).host;
|
const serverResourceHost = new URL(authInfo.url).host;
|
||||||
// const redirectHost = new URL(searchParams.redirect).host;
|
const redirectHost = new URL(searchParams.redirect).host;
|
||||||
//
|
|
||||||
// if (serverResourceHost === redirectHost) {
|
if (serverResourceHost === redirectHost) {
|
||||||
// redirectUrl = searchParams.redirect;
|
redirectUrl = searchParams.redirect;
|
||||||
// }
|
}
|
||||||
// } catch (e) {}
|
} catch (e) {}
|
||||||
// }
|
}
|
||||||
|
|
||||||
const hasAuth =
|
const hasAuth =
|
||||||
authInfo.password ||
|
authInfo.password ||
|
||||||
|
|||||||
Reference in New Issue
Block a user