修正钉钉入口公网跳转地址

This commit is contained in:
chenpei 2026-07-06 13:25:30 +08:00
parent 05efe45050
commit 67086c684b

View File

@ -4,6 +4,7 @@ import {
getAuthSessionCookieCandidates,
resolveSecureAuthCookieFromRequest,
} from '@/lib/auth-cookie'
import { getPublicAppOrigin } from '@/lib/public-app-url'
import { buildDingtalkAutoLoginPath, normalizeInternalRedirectPath } from '@/lib/safe-redirect'
async function resolveCurrentToken(request: NextRequest) {
@ -29,5 +30,5 @@ export async function GET(request: NextRequest) {
const token = await resolveCurrentToken(request)
const nextPath = token ? redirectPath : buildDingtalkAutoLoginPath(redirectPath)
return NextResponse.redirect(new URL(nextPath, request.url))
return NextResponse.redirect(new URL(nextPath, getPublicAppOrigin()))
}