Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN npm ci --no-audit --no-fund
# outDir is "server/public", so output lands at /ui/server/public here.
FROM ui-deps AS ui-build
WORKDIR /ui
COPY openapi.json orval.config.ts index.html vite.config.ts ./
COPY openapi.json orval.config.ts index.html vite.config.ts build-constants.ts ./
COPY tsconfig.json tsconfig.app.json tsconfig.node.json ./
COPY public ./public
COPY src ./src
Expand Down
2 changes: 1 addition & 1 deletion src/auth/AuthContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ describe("AuthContext", () => {
expect(window.location.href).toBe("/app/login");
});

expect(api.post).toHaveBeenCalledWith("/auth/logout");
expect(api.post).toHaveBeenCalledWith("/auth/logout", {});
expect(setCsrfToken).toHaveBeenLastCalledWith(null);
});

Expand Down
4 changes: 3 additions & 1 deletion src/auth/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ export function AuthProvider({ children }: { children: ReactNode }) {

const logout = useCallback(async (): Promise<void> => {
try {
await api.post<{ ok: boolean }>("/auth/logout");
// Empty body would still send Content-Type: application/json, which Fastify's
// default JSON parser 400s on — send {} to keep the header/body honest.
await api.post<{ ok: boolean }>("/auth/logout", {});
} catch {
// Client-side logout should still complete if the server-side session is already gone
// or the CSRF token has expired.
Expand Down
Loading