fix(web): 修复相对 OIDC 登录地址跳转
ci / verify (pull_request) Successful in 22m7s

This commit is contained in:
2026-07-20 15:26:44 +08:00
parent c070cda22a
commit d956524690
2 changed files with 27 additions and 1 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ export async function startOIDCLogin() {
const configuration = await loadOIDCRuntimeConfiguration(true);
if (!configuration.enabled || !configuration.oidcLogin || !configuration.loginUrl) throw new Error('统一认证未配置');
const returnTo = `${window.location.pathname}${window.location.search}${window.location.hash}` || '/';
const loginURL = new URL(identityEndpointURL(configuration.loginUrl));
const loginURL = new URL(identityEndpointURL(configuration.loginUrl), window.location.origin);
loginURL.searchParams.set('returnTo', returnTo.startsWith('/') ? returnTo : '/');
window.location.assign(loginURL.toString());
}