fix(core): unable to redirect to same origin paths (#6586)

This commit is contained in:
forehalo
2024-04-17 03:25:31 +00:00
parent 83d8587a45
commit 66a272fb8b
2 changed files with 20 additions and 7 deletions
@@ -1,5 +1,8 @@
export function popupWindow(target: string) {
const url = new URL(runtimeConfig.serverUrlPrefix + '/redirect-proxy');
target = /^https?:\/\//.test(target)
? target
: runtimeConfig.serverUrlPrefix + target;
url.searchParams.set('redirect_uri', target);
return window.open(url, '_blank', `noreferrer noopener`);