mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-07 10:30:32 +00:00
allow resource redirect if host is same
This commit is contained in:
@@ -56,16 +56,16 @@ export default async function ResourceAuthPage(props: {
|
||||
}
|
||||
|
||||
let redirectUrl = authInfo.url;
|
||||
// if (searchParams.redirect) {
|
||||
// try {
|
||||
// const serverResourceHost = new URL(authInfo.url).host;
|
||||
// const redirectHost = new URL(searchParams.redirect).host;
|
||||
//
|
||||
// if (serverResourceHost === redirectHost) {
|
||||
// redirectUrl = searchParams.redirect;
|
||||
// }
|
||||
// } catch (e) {}
|
||||
// }
|
||||
if (searchParams.redirect) {
|
||||
try {
|
||||
const serverResourceHost = new URL(authInfo.url).host;
|
||||
const redirectHost = new URL(searchParams.redirect).host;
|
||||
|
||||
if (serverResourceHost === redirectHost) {
|
||||
redirectUrl = searchParams.redirect;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
const hasAuth =
|
||||
authInfo.password ||
|
||||
|
||||
Reference in New Issue
Block a user