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

@@ -11,6 +11,7 @@
"vue": "^3.5.30"
},
"devDependencies": {
"@types/bcrypt": "^6.0.0",
"@types/node": "^24.12.0",
"@vitejs/plugin-vue": "^6.0.5",
"@vue/tsconfig": "^0.9.0",
@@ -415,6 +416,16 @@
"tslib": "^2.4.0"
}
},
"node_modules/@types/bcrypt": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/@types/bcrypt/-/bcrypt-6.0.0.tgz",
"integrity": "sha512-/oJGukuH3D2+D+3H4JWLaAsJ/ji86dhRidzZ/Od7H/i8g+aCmvkeCc6Ni/f9uxGLSQVCRZkX2/lqEFG2BvWtlQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/node": {
"version": "24.12.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz",

View File

@@ -12,6 +12,7 @@
"vue": "^3.5.30"
},
"devDependencies": {
"@types/bcrypt": "^6.0.0",
"@types/node": "^24.12.0",
"@vitejs/plugin-vue": "^6.0.5",
"@vue/tsconfig": "^0.9.0",

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import HelloWorld from './components/HelloWorld.vue'
import Login from './components/Login.vue';
</script>
<template>
<HelloWorld />
<Login />
</template>

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>

View File

@@ -1,5 +1,5 @@
import { createApp } from 'vue'
import './style.css'
// import './style.css'
import App from './App.vue'
createApp(App).mount('#app')