mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-03 13:26:48 +03:00
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
fix duplicated styles, move fonts to src/assets/fonts for vite to bundle (nginx already rewrites correctly), and fix fast refresh for PreviewController, auth context/provider, and statusbar context
26 lines
559 B
TypeScript
26 lines
559 B
TypeScript
import { createContext } from "react";
|
|
|
|
export interface AuthState {
|
|
user: { username: string; role: string | null } | null;
|
|
allowedCameras: string[];
|
|
isLoading: boolean;
|
|
isAuthenticated: boolean; // true if auth is required
|
|
}
|
|
|
|
interface AuthContextType {
|
|
auth: AuthState;
|
|
login: (user: AuthState["user"]) => void;
|
|
logout: () => void;
|
|
}
|
|
|
|
export const AuthContext = createContext<AuthContextType>({
|
|
auth: {
|
|
user: null,
|
|
allowedCameras: [],
|
|
isLoading: true,
|
|
isAuthenticated: false,
|
|
},
|
|
login: () => {},
|
|
logout: () => {},
|
|
});
|