fix(frontend/oidc): Prefix frontend base to redirect URL

This commit is contained in:
MidoriKurage 2026-03-21 21:37:53 +08:00 committed by kolaente
parent 57e2a33dc6
commit 44122bfe6b
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import {getFullBaseUrl} from '@/helpers/getFullBaseUrl'
import {createRandomID} from '@/helpers/randomId'
import type {IProvider} from '@/types/IProvider'
import {parseURL} from 'ufo'
@ -6,7 +7,8 @@ export function getRedirectUrlFromCurrentFrontendPath(provider: IProvider): stri
// We're not using the redirect url provided by the server to allow redirects when using the electron app.
// The implications are not quite clear yet hence the logic to pass in another redirect url still exists.
const url = parseURL(window.location.href)
return `${url.protocol}//${url.host}/auth/openid/${provider.key}`
const base = getFullBaseUrl()
return `${url.protocol}//${url.host}${base}auth/openid/${provider.key}`
}
export const redirectToProvider = (provider: IProvider) => {