refactor login flow and hooks, address autologin issues

This commit is contained in:
seavor 2026-04-18 10:14:31 -05:00
parent dcd6dc00f4
commit bd2382c94e
43 changed files with 2179 additions and 484 deletions

View file

@ -2,7 +2,10 @@ import { createContext, useContext, useState, ReactNode } from 'react';
import { WebClient } from '@app/websocket';
import { createWebClientRequest, createWebClientResponse } from '@app/api';
const WebClientContext = createContext<WebClient | null>(null);
// Exported so integration tests can inject the WebClient singleton built
// by their shared setup without going through the production provider
// (which would attempt to `new WebClient(...)` a second time and throw).
export const WebClientContext = createContext<WebClient | null>(null);
export function WebClientProvider({ children }: { children: ReactNode }) {
const [client] = useState(() => new WebClient(createWebClientRequest(), createWebClientResponse()));