Ajoutez des fichiers projet.

This commit is contained in:
2026-04-30 12:51:31 +02:00
parent d17cbe4df0
commit 72f4beeb61
57 changed files with 26895 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
import { useEffect } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
const AuthCallback = (): JSX.Element => {
const [searchParams] = useSearchParams();
const { handleCallback } = useAuth();
const navigate = useNavigate();
useEffect(() => {
const token = searchParams.get('token');
const error = searchParams.get('error');
if (error) {
navigate(`/login?error=${error}`);
return;
}
if (token) {
handleCallback(token);
navigate('/dashboard', { replace: true });
} else {
navigate('/login?error=no_token');
}
}, []);
return (
<div style={{
minHeight: '100vh',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontFamily: 'sans-serif',
fontSize: '18px',
color: '#f5f5dc',
}}>
Connexion en cours...
</div>
);
};
export default AuthCallback;