This commit is contained in:
Anthony Stirling 2025-11-14 11:34:51 +00:00
parent a9bf677384
commit 5f2114fb1a
7 changed files with 11 additions and 12 deletions

View File

@ -28,8 +28,8 @@ export interface ConfigColors {
}
export const createConfigNavSections = (
isAdmin: boolean = false,
runningEE: boolean = false,
_isAdmin: boolean = false,
_runningEE: boolean = false,
_loginEnabled: boolean = false
): ConfigNavSection[] => {
const sections: ConfigNavSection[] = [

View File

@ -97,8 +97,6 @@ export async function handleHttpError(error: any): Promise<boolean> {
const status: number | undefined = error?.response?.status;
if (status === 401) {
const pathname = window.location.pathname;
const errorMessage = error?.response?.data?.error || error?.response?.data?.message || '';
const isAuthenticationError = errorMessage.toLowerCase().includes('authentication');
// Check if we're already on an auth page
const isAuthPage = pathname.includes('/login') ||

View File

@ -11,7 +11,7 @@ import LoginRequiredBanner from '@app/components/shared/config/LoginRequiredBann
const AdminAuditSection: React.FC = () => {
const { t } = useTranslation();
const { loginEnabled, validateLoginEnabled, getDisabledStyles } = useLoginRequired();
const { loginEnabled } = useLoginRequired();
const [systemStatus, setSystemStatus] = useState<AuditStatus | null>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);

View File

@ -16,7 +16,7 @@ interface EndpointsSettingsData {
export default function AdminEndpointsSection() {
const { t } = useTranslation();
const { loginEnabled, validateLoginEnabled, getDisabledStyles } = useLoginRequired();
const { loginEnabled, validateLoginEnabled } = useLoginRequired();
const { restartModalOpened, showRestartModal, closeRestartModal, restartServer } = useRestartServer();
const {

View File

@ -20,7 +20,7 @@ interface LegalSettingsData {
export default function AdminLegalSection() {
const { t } = useTranslation();
const { loginEnabled, validateLoginEnabled, getDisabledStyles } = useLoginRequired();
const { loginEnabled, validateLoginEnabled } = useLoginRequired();
const { restartModalOpened, showRestartModal, closeRestartModal, restartServer } = useRestartServer();
const {

View File

@ -3,7 +3,7 @@ import { Navigate, useLocation } from 'react-router-dom'
import { useAuth } from '@app/auth/UseSession'
import { useAppConfig } from '@app/contexts/AppConfigContext'
import HomePage from '@app/pages/HomePage'
import Login from '@app/routes/Login'
// Login component is used via routing, not directly imported
import FirstLoginModal from '@app/components/shared/FirstLoginModal'
import { accountService } from '@app/services/accountService'

View File

@ -28,7 +28,7 @@ export default function Login() {
const [password, setPassword] = useState('');
const [enabledProviders, setEnabledProviders] = useState<string[]>([]);
const [hasSSOProviders, setHasSSOProviders] = useState(false);
const [enableLogin, setEnableLogin] = useState<boolean | null>(null);
const [_enableLogin, setEnableLogin] = useState<boolean | null>(null);
// Fetch enabled SSO providers and login config from backend
useEffect(() => {
@ -182,9 +182,10 @@ export default function Login() {
}
};
const handleForgotPassword = () => {
navigate('/auth/reset');
};
// Forgot password handler (currently unused, reserved for future implementation)
// const handleForgotPassword = () => {
// navigate('/auth/reset');
// };
return (
<AuthLayout>