Skip to content

Commit

Permalink
Fix redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Jul 2, 2024
1 parent fb6d501 commit 53d17bc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/containers/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ export async function handleShare(req: Request, res: Response, next) {
export async function handlePopupClose(req: Request, res: Response, next) {
try {
const state = new URLSearchParams(req.query.state.toString());
if (!process.env.AUTH_INSTANCE) { // main auth host
const instance = state.get('instance');
if (instance && instance.match(/^pr-\d+$/)) {
next();
return;
}
}

if (state.get('popupWindow') === 'true') {
openerRedirect(res, req.url.replace('popupWindow', ''));
return;
Expand Down

0 comments on commit 53d17bc

Please sign in to comment.