mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
lint
This commit is contained in:
parent
a9bf677384
commit
5f2114fb1a
@ -28,8 +28,8 @@ export interface ConfigColors {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const createConfigNavSections = (
|
export const createConfigNavSections = (
|
||||||
isAdmin: boolean = false,
|
_isAdmin: boolean = false,
|
||||||
runningEE: boolean = false,
|
_runningEE: boolean = false,
|
||||||
_loginEnabled: boolean = false
|
_loginEnabled: boolean = false
|
||||||
): ConfigNavSection[] => {
|
): ConfigNavSection[] => {
|
||||||
const sections: ConfigNavSection[] = [
|
const sections: ConfigNavSection[] = [
|
||||||
|
|||||||
@ -97,8 +97,6 @@ export async function handleHttpError(error: any): Promise<boolean> {
|
|||||||
const status: number | undefined = error?.response?.status;
|
const status: number | undefined = error?.response?.status;
|
||||||
if (status === 401) {
|
if (status === 401) {
|
||||||
const pathname = window.location.pathname;
|
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
|
// Check if we're already on an auth page
|
||||||
const isAuthPage = pathname.includes('/login') ||
|
const isAuthPage = pathname.includes('/login') ||
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import LoginRequiredBanner from '@app/components/shared/config/LoginRequiredBann
|
|||||||
|
|
||||||
const AdminAuditSection: React.FC = () => {
|
const AdminAuditSection: React.FC = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { loginEnabled, validateLoginEnabled, getDisabledStyles } = useLoginRequired();
|
const { loginEnabled } = useLoginRequired();
|
||||||
const [systemStatus, setSystemStatus] = useState<AuditStatus | null>(null);
|
const [systemStatus, setSystemStatus] = useState<AuditStatus | null>(null);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|||||||
@ -16,7 +16,7 @@ interface EndpointsSettingsData {
|
|||||||
|
|
||||||
export default function AdminEndpointsSection() {
|
export default function AdminEndpointsSection() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { loginEnabled, validateLoginEnabled, getDisabledStyles } = useLoginRequired();
|
const { loginEnabled, validateLoginEnabled } = useLoginRequired();
|
||||||
const { restartModalOpened, showRestartModal, closeRestartModal, restartServer } = useRestartServer();
|
const { restartModalOpened, showRestartModal, closeRestartModal, restartServer } = useRestartServer();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ interface LegalSettingsData {
|
|||||||
|
|
||||||
export default function AdminLegalSection() {
|
export default function AdminLegalSection() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { loginEnabled, validateLoginEnabled, getDisabledStyles } = useLoginRequired();
|
const { loginEnabled, validateLoginEnabled } = useLoginRequired();
|
||||||
const { restartModalOpened, showRestartModal, closeRestartModal, restartServer } = useRestartServer();
|
const { restartModalOpened, showRestartModal, closeRestartModal, restartServer } = useRestartServer();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { Navigate, useLocation } from 'react-router-dom'
|
|||||||
import { useAuth } from '@app/auth/UseSession'
|
import { useAuth } from '@app/auth/UseSession'
|
||||||
import { useAppConfig } from '@app/contexts/AppConfigContext'
|
import { useAppConfig } from '@app/contexts/AppConfigContext'
|
||||||
import HomePage from '@app/pages/HomePage'
|
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 FirstLoginModal from '@app/components/shared/FirstLoginModal'
|
||||||
import { accountService } from '@app/services/accountService'
|
import { accountService } from '@app/services/accountService'
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export default function Login() {
|
|||||||
const [password, setPassword] = useState('');
|
const [password, setPassword] = useState('');
|
||||||
const [enabledProviders, setEnabledProviders] = useState<string[]>([]);
|
const [enabledProviders, setEnabledProviders] = useState<string[]>([]);
|
||||||
const [hasSSOProviders, setHasSSOProviders] = useState(false);
|
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
|
// Fetch enabled SSO providers and login config from backend
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -182,9 +182,10 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleForgotPassword = () => {
|
// Forgot password handler (currently unused, reserved for future implementation)
|
||||||
navigate('/auth/reset');
|
// const handleForgotPassword = () => {
|
||||||
};
|
// navigate('/auth/reset');
|
||||||
|
// };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthLayout>
|
<AuthLayout>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user