Compare commits
4 Commits
dev
..
d09ebe23b5
| Author | SHA1 | Date | |
|---|---|---|---|
| d09ebe23b5 | |||
| 689c5105fe | |||
| c040b9e62d | |||
| b989b6e8e8 |
Generated
+4
-4
@@ -1038,8 +1038,8 @@ packages:
|
|||||||
ms@2.1.3:
|
ms@2.1.3:
|
||||||
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
|
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
|
||||||
|
|
||||||
nanoid@3.3.18:
|
nanoid@3.3.16:
|
||||||
resolution: {integrity: sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==}
|
resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}
|
||||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
@@ -2202,7 +2202,7 @@ snapshots:
|
|||||||
|
|
||||||
ms@2.1.3: {}
|
ms@2.1.3: {}
|
||||||
|
|
||||||
nanoid@3.3.18: {}
|
nanoid@3.3.16: {}
|
||||||
|
|
||||||
natural-compare@1.4.0: {}
|
natural-compare@1.4.0: {}
|
||||||
|
|
||||||
@@ -2249,7 +2249,7 @@ snapshots:
|
|||||||
|
|
||||||
postcss@8.5.25:
|
postcss@8.5.25:
|
||||||
dependencies:
|
dependencies:
|
||||||
nanoid: 3.3.18
|
nanoid: 3.3.16
|
||||||
picocolors: 1.1.1
|
picocolors: 1.1.1
|
||||||
source-map-js: 1.2.1
|
source-map-js: 1.2.1
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import Analytics from '@/pages/trustcenter/Analytics';
|
|||||||
import Backups from '@/pages/trustcenter/Backups';
|
import Backups from '@/pages/trustcenter/Backups';
|
||||||
import NewTicket from '@/pages/servicedesk/NewTicket';
|
import NewTicket from '@/pages/servicedesk/NewTicket';
|
||||||
import TicketDetail from '@/pages/servicedesk/TicketDetail';
|
import TicketDetail from '@/pages/servicedesk/TicketDetail';
|
||||||
import UpdatePasswordPage from './pages/accountsettings/UpdatePasswordPage';
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [isAuthenticated, setIsAuthenticated] = useState(pb.authStore.isValid);
|
const [isAuthenticated, setIsAuthenticated] = useState(pb.authStore.isValid);
|
||||||
@@ -64,7 +63,6 @@ function App() {
|
|||||||
<Route path="/backups" element={<Backups />} />
|
<Route path="/backups" element={<Backups />} />
|
||||||
<Route path="/support/new" element={<NewTicket />} />
|
<Route path="/support/new" element={<NewTicket />} />
|
||||||
<Route path="/support/tickets/:ticketId" element={<TicketDetail />} />
|
<Route path="/support/tickets/:ticketId" element={<TicketDetail />} />
|
||||||
<Route path="/settings/security/password" element={<UpdatePasswordPage />} />
|
|
||||||
|
|
||||||
{/* Sécurité : Si l'URL n'existe pas, on redirige vers le dashboard */}
|
{/* Sécurité : Si l'URL n'existe pas, on redirige vers le dashboard */}
|
||||||
<Route path="*" element={<Navigate to="/dashboard" replace />} />
|
<Route path="*" element={<Navigate to="/dashboard" replace />} />
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ interface BadgeProps {
|
|||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Badge: React.FC<BadgeProps> = ({ className, name }) => {
|
export const StatusBadge: React.FC<BadgeProps> = ({ className, name }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -20,4 +20,4 @@ export const Badge: React.FC<BadgeProps> = ({ className, name }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Badge;
|
export default StatusBadge;
|
||||||
@@ -1,74 +1,43 @@
|
|||||||
import React from 'react';
|
import { Card, CardContent, CardHeader } from '@/components/ui/Card';
|
||||||
import { Loader, Lock, KeyRound } from "lucide-react";
|
import { Lock } from "lucide-react";
|
||||||
import { useNavigate } from "react-router-dom"; // Assurez-vous d'utiliser react-router
|
|
||||||
import { Card } from '@/components/ui/Card';
|
|
||||||
import { Button } from '@/components/ui/Button';
|
|
||||||
import StatusBadge from '../ui/StatusBadge';
|
|
||||||
import type { User } from '@/types/User';
|
|
||||||
|
|
||||||
interface AccessWidgetProps {
|
export function AccessWidget() {
|
||||||
user: User | null;
|
|
||||||
isLoading: boolean;
|
|
||||||
error: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const AccessWidget: React.FC<AccessWidgetProps> = ({
|
|
||||||
user,
|
|
||||||
isLoading,
|
|
||||||
error,
|
|
||||||
}) => {
|
|
||||||
// Hook de navigation
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="flex flex-col h-full">
|
<Card>
|
||||||
<div className="p-6 border-b border-slate-300/30 dark:border-slate-700/30">
|
<CardHeader className="p-6 border-slate-100">
|
||||||
<h2 className="text-lg font-black text-slate-900 dark:text-slate-100 flex items-center gap-3">
|
<h2 className="text-lg font-semibold text-slate-900 border-slate-100 flex items-center"><Lock className="w-5 h-5 mr-2 text-slate-400"></Lock>Sécurité de l'accès</h2>
|
||||||
<div className="p-2 rounded-xl bg-[#e8e8e8] dark:bg-[#1e293b] shadow-[3px_3px_6px_#c5c5c5,-3px_-3px_6px_#ffffff] dark:shadow-[3px_3px_6px_#121926,-3px_-3px_6px_#2a3850]">
|
</CardHeader>
|
||||||
<Lock className="w-5 h-5 text-blue-600 dark:text-blue-500" />
|
|
||||||
</div>
|
|
||||||
Sécurité de l'accès
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{isLoading && !error && (
|
<CardContent className="space-y-6">
|
||||||
<div className="p-8 flex justify-center items-center flex-1">
|
{/* MFA Status */}
|
||||||
<Loader className="w-6 h-6 animate-spin text-blue-600" />
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-sm font-medium text-slate-900">Authentification à double facteur (MFA)</p>
|
||||||
|
<p className="text-xs text-slate-500 mt-1">Exigée par les politiques de sécurité GISE</p>
|
||||||
|
</div>
|
||||||
|
<span className="inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200">
|
||||||
|
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500 mr-1.5"></span>
|
||||||
|
Actif
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
{!isLoading && !error && (
|
<div className="pt-4 border-t border-slate-100">
|
||||||
<div className="p-6 space-y-8 flex-1">
|
<button className="text-sm font-medium text-blue-900 hover:text-blue-800 bg-blue-50 hover:bg-blue-100 px-4 py-2 rounded-lg transition-colors duration-200 border border-blue-100">
|
||||||
|
Générer de nouveaux codes de secours
|
||||||
{/* MFA */}
|
</button>
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<div>
|
|
||||||
<p className="text-sm font-bold text-slate-900 dark:text-slate-200">Authentification (MFA)</p>
|
|
||||||
<p className="text-xs font-medium text-slate-500 dark:text-slate-400 mt-1">Exigée par GISE</p>
|
|
||||||
</div>
|
|
||||||
<StatusBadge status={user?.mfa_enabled ? "Actif" : "Hors Ligne"} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* MOT DE PASSE (Lien vers la sous-page) */}
|
|
||||||
<div className="pt-8 border-t border-slate-300/30 dark:border-slate-700/30">
|
|
||||||
<p className="text-sm font-bold text-slate-900 dark:text-slate-200 mb-1">Mot de passe institutionnel</p>
|
|
||||||
<p className="text-xs font-medium text-slate-500 dark:text-slate-400 mb-5">Dernière modification : Il y a 43 jours</p>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
variant="primary"
|
|
||||||
size="sm"
|
|
||||||
// Navigation vers votre route dédiée
|
|
||||||
onClick={() => navigate('/settings/security/password')}
|
|
||||||
leftIcon={<KeyRound className="w-4 h-4" />}
|
|
||||||
className="w-full sm:w-auto"
|
|
||||||
>
|
|
||||||
Modifier le mot de passe
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
{/* Mot de passe */}
|
||||||
|
<div className="pt-4 border-t border-slate-100">
|
||||||
|
<p className="text-sm font-medium text-slate-900 mb-2">Mot de passe institutionnel</p>
|
||||||
|
<p className="text-xs text-slate-500 mb-4">Dernière modification : Il y a 43 jours</p>
|
||||||
|
<button className="text-sm font-medium text-slate-700 hover:text-slate-900 bg-white hover:bg-slate-50 border border-slate-300 px-4 py-2 rounded-lg transition-colors duration-200 shadow-sm">
|
||||||
|
Modifier le mot de passe
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AccessWidget;
|
export default AccessWidget;
|
||||||
@@ -1,33 +1,7 @@
|
|||||||
import { Card, CardContent, CardHeader } from '@/components/ui/Card';
|
import { Card, CardContent, CardHeader } from '@/components/ui/Card';
|
||||||
import type { Company } from '@/types/Company';
|
|
||||||
import type { User } from '@/types/User';
|
|
||||||
import { Loader } from '@/components/ui/Loader';
|
|
||||||
import { Building } from "lucide-react";
|
import { Building } from "lucide-react";
|
||||||
|
|
||||||
interface InformationWidgetProps {
|
export function InformationWidget() {
|
||||||
user: User | null;
|
|
||||||
company: Company | null;
|
|
||||||
isLoading: boolean;
|
|
||||||
error: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setVipBadge(vip_level: string | undefined) {
|
|
||||||
switch (vip_level?.toLowerCase()) {
|
|
||||||
case "platinum":
|
|
||||||
return <span className="px-2 py-1 bg-amber-600 text-white text-xs font-bold rounded shadow-sm mr-2 tracking-wider">{vip_level?.toUpperCase()}</span>;
|
|
||||||
case "premium":
|
|
||||||
return <span className="px-2 py-1 bg-violet-600 text-white text-xs font-bold rounded shadow-sm mr-2 tracking-wider">{vip_level?.toUpperCase()}</span>;
|
|
||||||
default:
|
|
||||||
return <span className="px-2 py-1 bg-blue-600 text-white text-xs font-bold rounded shadow-sm mr-2 tracking-wider">{vip_level?.toUpperCase()}</span>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const InformationWidget: React.FC<InformationWidgetProps> = ({
|
|
||||||
user,
|
|
||||||
company,
|
|
||||||
isLoading,
|
|
||||||
error,
|
|
||||||
}) => {
|
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader className="p-6 border-slate-100">
|
<CardHeader className="p-6 border-slate-100">
|
||||||
@@ -37,29 +11,25 @@ export const InformationWidget: React.FC<InformationWidgetProps> = ({
|
|||||||
</h2>
|
</h2>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|
||||||
{isLoading && !error && <Loader />}
|
<CardContent>
|
||||||
{!isLoading && !error && (
|
<dl className="space-y-4 text-sm">
|
||||||
<CardContent>
|
<div>
|
||||||
<dl className="space-y-4 text-sm">
|
<dt className="text-slate-500 font-medium">Entité Légale</dt>
|
||||||
<div>
|
<dd className="mt-1 font-semibold text-slate-900">Cabinet Juridique Example & Associés</dd>
|
||||||
<dt className="text-slate-500 font-medium">Entité Légale</dt>
|
</div>
|
||||||
<dd className="mt-1 font-semibold text-slate-900">{company?.name}</dd>
|
<div>
|
||||||
</div>
|
<dt className="text-slate-500 font-medium">Administrateur du compte</dt>
|
||||||
<div>
|
<dd className="mt-1 text-slate-900">Direction Générale (direction@example.com)</dd>
|
||||||
<dt className="text-slate-500 font-medium">Administrateur du compte</dt>
|
</div>
|
||||||
<dd className="mt-1 text-slate-900">{user?.role} {user?.name}</dd>
|
<div>
|
||||||
<dd className="mt-1 text-slate-500">Email : {user?.emailVisibility && user?.email}{!user?.emailVisibility && "caché"}</dd>
|
<dt className="text-slate-500 font-medium">Niveau d'Infogérance (SLA)</dt>
|
||||||
</div>
|
<dd className="mt-1 flex items-center">
|
||||||
<div>
|
<span className="px-2 py-1 bg-blue-900 text-white text-xs font-bold rounded shadow-sm mr-2 tracking-wider">VIP PLATINUM</span>
|
||||||
<dt className="text-slate-500 font-medium">Niveau d'Infogérance (SLA)</dt>
|
<span className="text-slate-700 font-medium">Couverture 24/7 (99.99%)</span>
|
||||||
<dd className="mt-1 flex items-center">
|
</dd>
|
||||||
{setVipBadge(company?.vip_level)}
|
</div>
|
||||||
<span className="text-slate-700 font-medium">Couverture 24/7 (99.99%)</span>
|
</dl>
|
||||||
</dd>
|
</CardContent>
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</CardContent>
|
|
||||||
)}
|
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ export function useDocumentDownload() {
|
|||||||
link.click();
|
link.click();
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
|
|
||||||
} catch {
|
} catch (err) {
|
||||||
|
console.error("Erreur lors du téléchargement sécurisé :", err);
|
||||||
setError("Accès refusé au coffre-fort documentaire.");
|
setError("Accès refusé au coffre-fort documentaire.");
|
||||||
} finally {
|
} finally {
|
||||||
setIsDownloading(false);
|
setIsDownloading(false);
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
import { pb } from "@/services/pocketbase";
|
|
||||||
import type { Company } from "@/types/Company";
|
|
||||||
import type { User } from "@/types/User";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
|
|
||||||
export const useUserInformations = () => {
|
|
||||||
const [user, setUser] = useState<User | null>(null);
|
|
||||||
const [company, setCompany] = useState<Company | null>(null);
|
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
|
||||||
const [error, setError] = useState<string | null>(null);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const fetchInformations = async () => {
|
|
||||||
setIsLoading(true);
|
|
||||||
try {
|
|
||||||
const userRecords = await pb.collection('aegis_users').getFullList<User>();
|
|
||||||
setUser(userRecords[0]);
|
|
||||||
const companyRecords = await pb.collection('aegis_companies').getFullList<Company>();
|
|
||||||
setCompany(companyRecords[0])
|
|
||||||
} catch (err) {
|
|
||||||
setError("Erreur lors de la récupération des infos utilisateur :"+err);
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
fetchInformations();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return { user, company, isLoading, error };
|
|
||||||
};
|
|
||||||
@@ -1,33 +1,29 @@
|
|||||||
import PageHeader from "@/components/ui/PageHeader";
|
import PageHeader from "@/components/ui/PageHeader";
|
||||||
import AccessWidget from "@/components/widgets/AccessWidget";
|
import AccessWidget from "@/components/widgets/AccessWidget";
|
||||||
import InformationWidget from "@/components/widgets/InformationWidget";
|
import InformationWidget from "@/components/widgets/InformationWidget";
|
||||||
import { useUserInformations } from "@/hooks/useUserInformations";
|
|
||||||
|
|
||||||
export default function AccountSettings() {
|
export default function AccountSettings() {
|
||||||
const { user, company, isLoading, error } = useUserInformations();
|
|
||||||
return (
|
return (
|
||||||
<div className="font-sans relative min-h-[calc(100vh-4rem)]">
|
<div className="font-sans relative min-h-[calc(100vh-4rem)]">
|
||||||
|
|
||||||
|
|
||||||
{/* Contenu Principal */}
|
{/* Contenu Principal */}
|
||||||
<main className="max-w-7xl mx-auto px-8 sm:px-8 space-y-6 m-4">
|
<main className="max-w-7xl mx-auto px-8 sm:px-8 space-y-6 m-4">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title="Paramètres du compte"
|
title="Paramètres du compte"
|
||||||
description="Gestion de la sécurité et informations contractuelles" />
|
description="Gestion de la sécurité et informations contractuelles" />
|
||||||
|
|
||||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
||||||
|
|
||||||
{/* Colonne 1 : Sécurité */}
|
{/* Colonne 1 : Sécurité */}
|
||||||
<AccessWidget
|
<AccessWidget/>
|
||||||
user={user}
|
|
||||||
isLoading={isLoading}
|
|
||||||
error={error}
|
|
||||||
/>
|
|
||||||
{/* Colonne 2 : Organisation & Contrat */}
|
{/* Colonne 2 : Organisation & Contrat */}
|
||||||
<InformationWidget
|
<InformationWidget/>
|
||||||
user={user}
|
|
||||||
company={company}
|
|
||||||
isLoading={isLoading}
|
|
||||||
error={error}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,142 +0,0 @@
|
|||||||
import React, { useState } from 'react';
|
|
||||||
import { useNavigate } from 'react-router-dom';
|
|
||||||
import { KeyRound, AlertCircle, ShieldCheck } from "lucide-react";
|
|
||||||
import { Card } from '@/components/ui/Card';
|
|
||||||
import { Input } from '@/components/ui/Input';
|
|
||||||
import { Button } from '@/components/ui/Button';
|
|
||||||
import { pb } from '@/services/pocketbase';
|
|
||||||
import BackButton from '@/components/ui/BackButton';
|
|
||||||
import { NEUMORPHISM } from '@/styles/Neumorphism';
|
|
||||||
|
|
||||||
export default function UpdatePasswordPage() {
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const [isUpdating, setIsUpdating] = useState(false);
|
|
||||||
const [feedback, setFeedback] = useState<{ type: 'error' | 'success', message: string } | null>(null);
|
|
||||||
|
|
||||||
const [formData, setFormData] = useState({
|
|
||||||
oldPassword: '',
|
|
||||||
newPassword: '',
|
|
||||||
confirmPassword: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const handlePasswordChange = async (e: React.FormEvent) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setIsUpdating(true);
|
|
||||||
setFeedback(null);
|
|
||||||
|
|
||||||
if (formData.newPassword !== formData.confirmPassword) {
|
|
||||||
setFeedback({ type: 'error', message: "Les nouveaux mots de passe ne correspondent pas." });
|
|
||||||
setIsUpdating(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (formData.newPassword.length < 8) {
|
|
||||||
setFeedback({ type: 'error', message: "Le mot de passe doit contenir au moins 8 caractères minimum." });
|
|
||||||
setIsUpdating(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const userId = pb.authStore.model?.id;
|
|
||||||
if (!userId) throw new Error("Non authentifié.");
|
|
||||||
|
|
||||||
await pb.collection("users").update(userId, {
|
|
||||||
oldPassword: formData.oldPassword,
|
|
||||||
password: formData.newPassword,
|
|
||||||
passwordConfirm: formData.confirmPassword,
|
|
||||||
});
|
|
||||||
|
|
||||||
setFeedback({ type: 'success', message: "Votre mot de passe a été modifié avec succès." });
|
|
||||||
setFormData({ oldPassword: '', newPassword: '', confirmPassword: '' });
|
|
||||||
|
|
||||||
// Retour automatique après 2.5 secondes
|
|
||||||
setTimeout(() => navigate(-1), 2500);
|
|
||||||
|
|
||||||
} catch {
|
|
||||||
setFeedback({ type: 'error', message: "Ancien mot de passe incorrect ou erreur réseau." });
|
|
||||||
} finally {
|
|
||||||
setIsUpdating(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<div className="max-w-4xl mx-auto py-8 px-4 space-y-6">
|
|
||||||
|
|
||||||
{/* BOUTON DE RETOUR EXTRAIT */}
|
|
||||||
<BackButton to="/account" label="Retour aux paramètres" />
|
|
||||||
|
|
||||||
{/* LE FORMULAIRE */}
|
|
||||||
<Card className="p-8 sm:p-10">
|
|
||||||
<div className="flex items-center gap-4 mb-8 pb-6 border-b border-slate-300/30 dark:border-slate-700/30">
|
|
||||||
<div className="p-4 rounded-2xl bg-[#e8e8e8] dark:bg-[#1e293b] shadow-[3px_3px_6px_#c5c5c5,-3px_-3px_6px_#ffffff] dark:shadow-[3px_3px_6px_#121926,-3px_-3px_6px_#2a3850]">
|
|
||||||
<KeyRound className="w-8 h-8 text-slate-700 dark:text-slate-200" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h1 className="text-2xl font-black text-slate-800 dark:text-slate-100 tracking-tight">
|
|
||||||
Renouvellement du mot de passe
|
|
||||||
</h1>
|
|
||||||
<p className="text-slate-500 dark:text-slate-400 font-medium mt-1">
|
|
||||||
Veuillez choisir un mot de passe fort et unique pour sécuriser votre accès AEGIS.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form onSubmit={handlePasswordChange} className="space-y-6">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Input
|
|
||||||
label="Mot de passe actuel"
|
|
||||||
type="password"
|
|
||||||
required
|
|
||||||
placeholder="••••••••"
|
|
||||||
value={formData.oldPassword}
|
|
||||||
onChange={(e) => setFormData({ ...formData, oldPassword: e.target.value })}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="grid sm:grid-cols-2 gap-6 pt-4">
|
|
||||||
<Input
|
|
||||||
label="Nouveau mot de passe"
|
|
||||||
type="password"
|
|
||||||
required
|
|
||||||
placeholder="••••••••"
|
|
||||||
value={formData.newPassword}
|
|
||||||
onChange={(e) => setFormData({ ...formData, newPassword: e.target.value })}
|
|
||||||
/>
|
|
||||||
<Input
|
|
||||||
label="Confirmez le nouveau mot de passe"
|
|
||||||
type="password"
|
|
||||||
required
|
|
||||||
placeholder="••••••••"
|
|
||||||
value={formData.confirmPassword}
|
|
||||||
onChange={(e) => setFormData({ ...formData, confirmPassword: e.target.value })}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Zone de Feedback */}
|
|
||||||
{feedback && (
|
|
||||||
<div className={`p-4 mt-4 rounded-xl flex items-center gap-3 text-sm font-bold ${feedback.type === 'error'
|
|
||||||
? `bg-rose-50/50 dark:bg-rose-950/20 text-rose-600 dark:text-rose-400 ${NEUMORPHISM.insetLight} ${NEUMORPHISM.insetDark}`
|
|
||||||
: `bg-emerald-50/50 dark:bg-emerald-950/20 text-emerald-600 dark:text-emerald-400 ${NEUMORPHISM.insetLight} ${NEUMORPHISM.insetDark}`
|
|
||||||
}`}>
|
|
||||||
{feedback.type === 'error' ? <AlertCircle className="w-5 h-5 shrink-0" /> : <ShieldCheck className="w-5 h-5 shrink-0" />}
|
|
||||||
{feedback.message}
|
|
||||||
{feedback.type === 'success' && <span className="ml-auto font-normal text-xs animate-pulse">Redirection...</span>}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="pt-6 flex justify-center">
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
variant="primary"
|
|
||||||
size="lg"
|
|
||||||
isLoading={isUpdating}
|
|
||||||
disabled={!formData.oldPassword || !formData.newPassword || !formData.confirmPassword}
|
|
||||||
>
|
|
||||||
Valider le nouveau mot de passe
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
export interface Company {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
no: string;
|
|
||||||
vip_level: string;
|
|
||||||
created: string;
|
|
||||||
updated: string
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
export interface User {
|
|
||||||
id: string;
|
|
||||||
email: string;
|
|
||||||
emailVisibility: boolean;
|
|
||||||
verified: boolean;
|
|
||||||
name: string;
|
|
||||||
role: string;
|
|
||||||
company: string;
|
|
||||||
mfa_enabled: boolean;
|
|
||||||
created: string;
|
|
||||||
updated: string
|
|
||||||
}
|
|
||||||
+14
-14
@@ -11,20 +11,20 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(import.meta.dirname, './src'),
|
'@': path.resolve(__dirname, './src'),
|
||||||
'@components': path.resolve(import.meta.dirname, './src/components'),
|
'@components': path.resolve(__dirname, './src/components'),
|
||||||
'@ui': path.resolve(import.meta.dirname, './src/components/ui'),
|
'@ui': path.resolve(__dirname, './src/components/ui'),
|
||||||
'@common': path.resolve(import.meta.dirname, './src/components/common'),
|
'@common': path.resolve(__dirname, './src/components/common'),
|
||||||
'@pages': path.resolve(import.meta.dirname, './src/pages'),
|
'@pages': path.resolve(__dirname, './src/pages'),
|
||||||
'@hooks': path.resolve(import.meta.dirname, './src/hooks'),
|
'@hooks': path.resolve(__dirname, './src/hooks'),
|
||||||
'@layouts': path.resolve(import.meta.dirname, './src/layouts'),
|
'@layouts': path.resolve(__dirname, './src/layouts'),
|
||||||
'@features': path.resolve(import.meta.dirname, './src/features'),
|
'@features': path.resolve(__dirname, './src/features'),
|
||||||
'@services': path.resolve(import.meta.dirname, './src/services'),
|
'@services': path.resolve(__dirname, './src/services'),
|
||||||
'@utils': path.resolve(import.meta.dirname, './src/utils'),
|
'@utils': path.resolve(__dirname, './src/utils'),
|
||||||
'@assets': path.resolve(import.meta.dirname, './src/assets'),
|
'@assets': path.resolve(__dirname, './src/assets'),
|
||||||
'@data': path.resolve(import.meta.dirname, './src/data'),
|
'@data': path.resolve(__dirname, './src/data'),
|
||||||
'@widgets': path.resolve(import.meta.dirname, './src/components/widgets'),
|
'@widgets': path.resolve(__dirname, './src/components/widgets'),
|
||||||
'@styles': path.resolve(import.meta.dirname, './src/styles'),
|
'@styles': path.resolve(__dirname, './src/styles'),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user