Skip to content

Commit

Permalink
Transport the dark mode state to the login theme
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Dec 16, 2024
1 parent 9d6e7fa commit 0ee70f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/oidc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createReactOidc } from "oidc-spa/react";
import { createMockReactOidc } from "oidc-spa/mock/react";
import { z } from "zod";
import { getIsDark } from "@codegouvfr/react-dsfr/useIsDark";

const decodedIdTokenSchema = z.object({
sub: z.string(),
Expand All @@ -15,7 +16,10 @@ export const { OidcProvider, useOidc, getOidc } = issuerUri
issuerUri,
clientId,
publicUrl: import.meta.env.BASE_URL,
decodedIdTokenSchema: decodedIdTokenSchema
decodedIdTokenSchema: decodedIdTokenSchema,
extraQueryParams: () => ({
dark: getIsDark() ? "true" : "false"
})
//doEnableDebugLogs: true
})
: createMockReactOidc({
Expand Down

0 comments on commit 0ee70f4

Please sign in to comment.