allow resource redirect if host is same

This commit is contained in:
Milo Schwartz
2025-01-10 00:13:51 -05:00
parent fcc6cad6d7
commit c3d19454f7
2 changed files with 11 additions and 12 deletions

View File

@@ -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 ||