fix: silence expected console noise from OIDC discovery and router hydration
CI / Build & Quality Checks (push) Successful in 10m10s
CI / Build & Quality Checks (push) Successful in 10m10s
- ServerConfigsLoader: skip validateAuthMetadata when getAuthMetadata()
rejects (404 on /auth_issuer means server uses traditional SSO, not
native Matrix OIDC/MAS - this is expected and should not log errors)
- Router: use HydrateFallback={() => null} instead of hydrateFallbackElement={null}
so react-router v7 counts it as truthy and suppresses the spurious warning
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,10 +31,14 @@ export function ServerConfigsLoader({ children }: ServerConfigsLoaderProps) {
|
||||
const authMetadata = promiseFulfilledResult(result[2]);
|
||||
let validatedAuthMetadata: ValidatedAuthMetadata | undefined;
|
||||
|
||||
try {
|
||||
validatedAuthMetadata = validateAuthMetadata(authMetadata);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
// Only validate if the server returned metadata — a rejected promise means no native
|
||||
// Matrix OIDC (MSC3861/MAS), which is normal for servers using traditional SSO.
|
||||
if (authMetadata !== undefined) {
|
||||
try {
|
||||
validatedAuthMetadata = validateAuthMetadata(authMetadata);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -105,7 +105,7 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
|
||||
const mobile = screenSize === ScreenSize.Mobile;
|
||||
|
||||
const routes = createRoutesFromElements(
|
||||
<Route hydrateFallbackElement={null}>
|
||||
<Route HydrateFallback={() => null}>
|
||||
<Route
|
||||
index
|
||||
loader={() => {
|
||||
|
||||
Reference in New Issue
Block a user