mirror of
https://github.com/rustfs/console.git
synced 2026-09-01 15:17:45 +08:00
5b8c03dc44
Co-authored-by: Philipp Kolberg <thegrandpkizzle@gmail.com>
17 lines
614 B
JavaScript
17 lines
614 B
JavaScript
import test from "node:test"
|
|
import assert from "node:assert/strict"
|
|
import fs from "node:fs"
|
|
|
|
const source = fs.readFileSync("contexts/auth-context.tsx", "utf8")
|
|
|
|
test("OIDC federated logout builds its destination before clearing auth state", () => {
|
|
assert.match(
|
|
source,
|
|
/const logoutUrl = buildOidcLogoutUrl\(config\.serverHost, oidcSession\.logoutToken\)\s*\n\s*logout\(\)\s*\n\s*window\.location\.href = logoutUrl/,
|
|
)
|
|
})
|
|
|
|
test("OIDC federated logout does not clear auth state before awaiting config", () => {
|
|
assert.doesNotMatch(source, /logout\(\)\s*\n\s*if \(!oidcSession\) return false/)
|
|
})
|