@snokam/auth 6.1.3 → 6.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.1.4](https://github.com/snokam/components/compare/%40snokam%2Fauth%406.1.3...%40snokam%2Fauth%406.1.4) (2026-11-10)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **ui:** no dark-tag flash on load, toast actions in normal case ([#3426](https://github.com/snokam/components/issues/3426)) ([360d51d](https://github.com/snokam/components/commit/360d51d909483317dc22b7266de9f1dde80f9eef))
11
+
6
12
  ## [6.1.3](https://github.com/snokam/components/compare/%40snokam%2Fauth%406.1.1...%40snokam%2Fauth%406.1.3) (2026-11-10)
7
13
 
8
14
  **Note:** Version bump only for package @snokam/auth
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@snokam/auth",
3
3
  "description": "Snøkam auth components",
4
- "version": "6.1.3",
4
+ "version": "6.1.4",
5
5
  "main": "src/index.ts",
6
6
  "sideEffects": false,
7
7
  "types": "src/index.ts",
@@ -26,12 +26,12 @@
26
26
  "@mui/material": "^9.5.0",
27
27
  "next-auth": "4.24.15",
28
28
  "path-to-regexp": "^9.0.0",
29
- "@snokam/api-client": "1.0.0",
30
29
  "@snokam/identity": "1.1.1",
31
- "@snokam/page-content": "6.9.12",
30
+ "@snokam/page-content": "6.9.13",
32
31
  "@snokam/react-query": "1.1.1",
33
32
  "@snokam/tenant": "4.5.5",
34
- "@snokam/ui": "7.3.3"
33
+ "@snokam/ui": "7.3.4",
34
+ "@snokam/api-client": "1.0.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "next": "16.4.5",
@@ -1,12 +1,20 @@
1
1
  "use client";
2
2
 
3
- import { lazy, Suspense } from "react";
3
+ import { lazy, Suspense, useEffect } from "react";
4
+ import { useAdminTheme } from "@snokam/ui/theme/admin";
4
5
  import { useAuth } from "../hooks";
5
6
 
6
7
  const SavedThemeSync = lazy(() => import("./saved-theme-sync"));
7
8
 
8
9
  export function EmployeeThemeSync() {
9
- const { isAuthenticated } = useAuth();
10
+ const { isAuthenticated, inProgress } = useAuth();
11
+ const { markSeeded } = useAdminTheme();
12
+ const signedOut = !isAuthenticated && !inProgress;
13
+
14
+ useEffect(() => {
15
+ if (signedOut) markSeeded();
16
+ }, [signedOut, markSeeded]);
17
+
10
18
  if (!isAuthenticated) return null;
11
19
 
12
20
  return (
@@ -17,7 +17,7 @@ function isMode(value: unknown): value is ColorSchemeMode {
17
17
 
18
18
  export default function SavedThemeSync() {
19
19
  const { isAuthenticated, getToken } = useAuth();
20
- const { seedMode } = useAdminTheme();
20
+ const { seedMode, markSeeded } = useAdminTheme();
21
21
  const config = useOptionalConfig();
22
22
 
23
23
  const basePath = config ? apiBaseUrl(config) : undefined;
@@ -32,7 +32,7 @@ export default function SavedThemeSync() {
32
32
  [basePath, isAuthenticated, getToken]
33
33
  );
34
34
 
35
- const { data } = useClientQuery({
35
+ const { data, isSuccess, isError } = useClientQuery({
36
36
  name: "Employees",
37
37
  client,
38
38
  }).useGetMeProtectedQuery(
@@ -44,10 +44,12 @@ export default function SavedThemeSync() {
44
44
  );
45
45
 
46
46
  const saved = data?.settings?.colorScheme;
47
+ const settled = isSuccess || isError || !basePath;
47
48
 
48
49
  useEffect(() => {
49
50
  if (isMode(saved)) seedMode(saved);
50
- }, [saved, seedMode]);
51
+ else if (settled) markSeeded();
52
+ }, [saved, settled, seedMode, markSeeded]);
51
53
 
52
54
  return null;
53
55
  }