mirror of
https://github.com/rustfs/console.git
synced 2026-08-28 19:47:21 +08:00
chore: upgrade next to 16.3 canary
This commit is contained in:
+11
-3
@@ -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
@@ -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",
|
||||
|
||||
Generated
+324
-196
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -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/)
|
||||
})
|
||||
Reference in New Issue
Block a user