-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
99 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="fr"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Page d'accueil</title> | ||
<!-- Ajouter Bootstrap CSS --> | ||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+Knujsl5+zr/2+AzmbPFEY1pck9Oi7qOB7w5BzWRwKtk81U" crossorigin="anonymous"> | ||
<style> | ||
/* Styles personnalisés ici */ | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1 class="mt-5">Bienvenue sur notre site</h1> | ||
<p>Ceci est une page d'accueil simple.</p> | ||
<!-- Bouton de déconnexion --> | ||
<button id="btnLogout" class="btn btn-danger mt-3">Déconnexion</button> | ||
</div> | ||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-QFhL/tFfQaTZYZF/Q2vRTJPnC/tfG4S7ZcK/GK8fSYyZOd4yi7ujF0pDc5cW4kE1" crossorigin="anonymous"></script> | ||
<script> | ||
// Ajoutez votre code JavaScript personnalisé ici | ||
document.getElementById("btnLogout").addEventListener("click", function() { | ||
// Redirection vers la route de déconnexion | ||
fetch('/logout', { | ||
method: 'POST', | ||
credentials: 'same-origin' | ||
}) | ||
.then(response => { | ||
if (response.ok) { | ||
// Si la déconnexion réussit, redirigez l'utilisateur vers la page de connexion | ||
window.location.href = '/login'; // Remplacez '/login' par l'URL de votre page de connexion | ||
} else { | ||
console.error('Erreur lors de la déconnexion'); | ||
} | ||
}) | ||
.catch(error => { | ||
console.error('Erreur lors de la déconnexion :', error); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |