fix(auth): runtime allowlist return_to с private для LAN SSO
Build and Push Auth Portal Docker Image / build-and-push (push) Successful in 3m15s
Build and Push Auth Portal Docker Image / create-release (push) Skipped

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-07-18 14:00:05 +07:00
co-authored by Cursor
parent 1cc58977fd
commit 961242506b
5 changed files with 51 additions and 18 deletions
+3 -10
View File
@@ -17,16 +17,11 @@ import {
AlertDescription,
AlertTitle,
} from '@/components/reui/alert'
import { setToken } from '@/lib/auth'
import { ensureReturnToAllowlist, setToken } from '@/lib/auth'
import { ApiError } from '@/lib/api-client'
import { login, meQueryKey } from '@/queries/auth'
import { AuthLogo } from '@/components/blocks/auth-18/components/auth-logo'
/** Dev default matches auth-portal .env.example; prod should pass via Vite if needed. */
const RETURN_TO_ALLOWLIST =
import.meta.env.VITE_RETURN_TO_ALLOWLIST ??
'.shnt.top,localhost,http://localhost:5173'
export function PortalLoginForm() {
const navigate = useNavigate()
const queryClient = useQueryClient()
@@ -48,10 +43,8 @@ export function PortalLoginForm() {
setToken(res.access_token)
queryClient.setQueryData(meQueryKey, res.user)
if (
returnTo &&
isReturnToAllowed(returnTo, RETURN_TO_ALLOWLIST)
) {
const allowlist = await ensureReturnToAllowlist()
if (returnTo && isReturnToAllowed(returnTo, allowlist)) {
window.location.href = buildSsoRedirectUrl(
returnTo,
res.access_token,