20 lines
714 B
HTML
20 lines
714 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
<script>
|
|
// Récupération du code dans l'URL
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
const code = urlParams.get('code');
|
|
|
|
if (code) {
|
|
// Ici, normalement, on échange le code contre un token via un fetch vers l'IdP
|
|
// Pour l'exemple, on simule la réussite :
|
|
localStorage.setItem('auth_token', 'session_active_' + btoa(code));
|
|
window.location.href = 'index.html';
|
|
} else {
|
|
document.body.innerHTML = "Erreur d'authentification. Redirection...";
|
|
setTimeout(() => window.location.href = 'index.html', 2000);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |