chore: upgrade next to 16.3 canary

This commit is contained in:
cxymds
2026-07-02 15:49:43 +08:00
parent b4fad62377
commit ae01aee350
5 changed files with 369 additions and 201 deletions
+11 -3
View File
@@ -20,14 +20,22 @@ export async function fetchOidcProviders(serverHost: string): Promise<OidcProvid
}
/**
* Redirect the browser to the OIDC authorization endpoint.
* Build the backend OIDC authorization endpoint URL.
*/
export function initiateOidcLogin(serverHost: string, providerId: string, redirectAfter?: string): void {
export function buildOidcLoginUrl(serverHost: string, providerId: string, redirectAfter?: string): string {
let url = `${serverHost}/rustfs/admin/v3/oidc/authorize/${encodeURIComponent(providerId)}`
if (redirectAfter) {
url += `?redirect_after=${encodeURIComponent(redirectAfter)}`
}
window.location.href = url
return url
}
/**
* Redirect the browser to the OIDC authorization endpoint.
*/
export function initiateOidcLogin(serverHost: string, providerId: string, redirectAfter?: string): void {
const url = buildOidcLoginUrl(serverHost, providerId, redirectAfter)
window.location.href = new URL(url, window.location.origin).href
}
/**
+2 -2
View File
@@ -36,7 +36,7 @@
"i18next": "^26.3.1",
"i18next-browser-languagedetector": "^8.2.1",
"input-otp": "^1.4.2",
"next": "^16.2.9",
"next": "16.3.0-canary.74",
"next-themes": "^0.4.6",
"node-forge": "^1.4.0",
"react": "^19.2.7",
@@ -59,7 +59,7 @@
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"eslint": "^9.39.4",
"eslint-config-next": "^16.2.9",
"eslint-config-next": "16.3.0-canary.74",
"eslint-config-prettier": "^10.1.8",
"prettier": "^3.8.4",
"tailwindcss": "^4.3.0",
+324 -196
View File
File diff suppressed because it is too large Load Diff
+13
View File
@@ -1,3 +1,16 @@
allowBuilds:
sharp: false
unrs-resolver: false
minimumReleaseAgeExclude:
- "@next/env@16.3.0-canary.74"
- "@next/swc-darwin-arm64@16.3.0-canary.74"
- "@next/swc-darwin-x64@16.3.0-canary.74"
- "@next/swc-linux-arm64-gnu@16.3.0-canary.74"
- "@next/swc-linux-arm64-musl@16.3.0-canary.74"
- "@next/swc-linux-x64-gnu@16.3.0-canary.74"
- "@next/swc-linux-x64-musl@16.3.0-canary.74"
- "@next/swc-win32-arm64-msvc@16.3.0-canary.74"
- "@next/swc-win32-x64-msvc@16.3.0-canary.74"
- next@16.3.0-canary.74
- "@next/eslint-plugin-next@16.3.0-canary.74"
- eslint-config-next@16.3.0-canary.74
+19
View File
@@ -0,0 +1,19 @@
import test from "node:test"
import assert from "node:assert/strict"
import fs from "node:fs"
const source = fs.readFileSync("lib/oidc.ts", "utf8")
test("OIDC login URL construction stays isolated from browser navigation", () => {
assert.match(
source,
/export function buildOidcLoginUrl\(serverHost: string, providerId: string, redirectAfter\?: string\): string/,
)
assert.match(source, /encodeURIComponent\(providerId\)/)
assert.match(source, /redirect_after=\$\{encodeURIComponent\(redirectAfter\)\}/)
})
test("initiateOidcLogin normalizes the destination before assigning location.href", () => {
assert.match(source, /const url = buildOidcLoginUrl\(serverHost, providerId, redirectAfter\)/)
assert.match(source, /window\.location\.href = new URL\(url, window\.location\.origin\)\.href/)
})