export interface User {
  id: string;
  email: string;
  name: string;
  given_name: string;
  family_name: string;
  preferred_username?: string;
  groups?: string[];
}

export interface AuthTokens {
  token: string;
  refreshToken?: string;
  expiresIn?: number;
}

export interface AuthState {
  user: User | null;
  token: string | null;
  isAuthenticated: boolean;
  isLoading: boolean;
}

export interface LoginResult {
  isNewUser?: boolean;
}

export interface AuthContextType extends AuthState {
  login: (code: string) => Promise<LoginResult>;
  logout: () => void;
  refreshAuth: () => Promise<void>;
}
