- Deleted the Account page and its associated logic. - Introduced a new PassthroughLanding page for users without management access. - Updated Settings page to conditionally display the Users link for admin users. - Enhanced UsersPage to support passthrough user role, including invite functionality and user detail modal. - Updated tests to reflect changes in user roles and navigation.
20 lines
499 B
TypeScript
20 lines
499 B
TypeScript
import { createContext } from 'react';
|
|
|
|
export interface User {
|
|
user_id: number;
|
|
role: 'admin' | 'user' | 'passthrough';
|
|
name?: string;
|
|
email?: string;
|
|
}
|
|
|
|
export interface AuthContextType {
|
|
user: User | null;
|
|
login: (token?: string) => Promise<void>;
|
|
logout: () => void;
|
|
changePassword: (oldPassword: string, newPassword: string) => Promise<void>;
|
|
isAuthenticated: boolean;
|
|
isLoading: boolean;
|
|
}
|
|
|
|
export const AuthContext = createContext<AuthContextType | undefined>(undefined);
|