Files
SAE_riot/components/login.riot

49 lines
1.3 KiB
Plaintext
Raw Normal View History

2025-03-28 13:53:35 +01:00
<login>
<h2>Connexion</h2>
<form onsubmit={loginUser}>
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="Mot de passe" required>
<button>Se connecter</button>
</form>
<p><a href="#/register">Pas encore de compte ?</a></p>
<script>
async function loginUser(e) {
e.preventDefault();
const email = e.target.email.value;
const password = e.target.password.value;
2025-03-28 16:27:07 +01:00
await login(email, password);
2025-03-28 13:53:35 +01:00
window.location.href = '#';
}
export default {
loginUser
}
</script>
<style>
form {
display: flex;
flex-direction: column;
max-width: 300px;
margin: auto;
gap: 10px;
margin-top: 2rem;
}
input,
button {
padding: 0.5rem;
border-radius: 4px;
border: 1px solid #ccc;
}
button {
background-color: #1976d2;
color: white;
border: none;
cursor: pointer;
}
button:hover {
background-color: #135ba1;
}
</style>
</login>