user signin

This commit is contained in:
2026-03-18 23:52:28 +00:00
parent af075b9a24
commit 7b9c212c0e
12 changed files with 657 additions and 14 deletions

View File

@@ -0,0 +1,28 @@
<script setup lang="ts">
import { ref } from 'vue';
const email = ref<string>("");
const pass = ref<string>("");
function login(e: SubmitEvent) {
e.preventDefault();
console.log(`${email.value} ${pass.value}`);
fetch("http://localhost:3000/login", {
method: "POST",
body: JSON.stringify({ email: email.value, pass: pass.value}),
headers: new Headers({'content-type': 'application/json'})
});
}
</script>
<template>
<form @submit="login">
<label for="email">Email</label> <br>
<input type="email" id="email" v-model="email"/> <br>
<label for="pass">Password</label> <br>
<input type="password" id="pass" v-model="pass"/> <br>
<button type="submit">Sign in</button> <br>
<button type="button">Sign up</button>
</form>
</template>