This commit is contained in:
2025-03-28 13:53:35 +01:00
commit d2848447b6
8 changed files with 521 additions and 0 deletions

57
components/register.riot Normal file
View File

@@ -0,0 +1,57 @@
<register>
<h2>Inscription</h2>
<form onsubmit={registerUser}>
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="Mot de passe" required>
<button>S'inscrire</button>
</form>
<p><a href="#/login">Déjà un compte ?</a></p>
<script>
export default {
async registerUser(e) {
e.preventDefault();
const email = e.target.email.value;
const password = e.target.password.value;
window.sign(email, password);
window.location.href = '#';
},
onMounted() {
observeAuthState(user => {
if (user) {
console.log("Connecté :", user.email);
} else {
console.log("Déconnecté");
}
});
}
}
</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>
</register>