user signin
This commit is contained in:
28
frontend/src/components/Login.vue
Normal file
28
frontend/src/components/Login.vue
Normal 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>
|
||||
Reference in New Issue
Block a user