49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
|
|
<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;
|
||
|
|
login(email, password);
|
||
|
|
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>
|