diff --git a/.DS_Store b/.DS_Store
index aaf4507..0fc2194 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/client/package.json b/client/package.json
index 1ece17f..46403f3 100644
--- a/client/package.json
+++ b/client/package.json
@@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
- "@100xdevs/common": "^1.0.1",
+ "@shawakash/common2": "^1.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.14.2",
diff --git a/client/src/Components/Login.tsx b/client/src/Components/Login.tsx
index b9a5148..f1906fa 100644
--- a/client/src/Components/Login.tsx
+++ b/client/src/Components/Login.tsx
@@ -1,21 +1,24 @@
+import { userParams } from '@shawakash/common2';
import React, { useState } from 'react';
-import {Link} from 'react-router-dom';
+import {Link, useNavigate} from 'react-router-dom';
-const Login = () => {
+const Login: React.FC = () => {
+ const navigate = useNavigate()
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const handleLogin = async () => {
+ const reqBody: userParams = {username, password}
const response = await fetch('http://localhost:3000/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ username, password })
+ body: JSON.stringify(reqBody)
});
// Todo: Create a type for the response that you get back from the server
const data = await response.json();
if (data.token) {
localStorage.setItem("token", data.token)
- window.location = "/todos";
+ navigate("/todos");
} else {
alert("invalid credentials");
}
diff --git a/client/src/Components/Signup.tsx b/client/src/Components/Signup.tsx
index 95afa2f..fee1c74 100644
--- a/client/src/Components/Signup.tsx
+++ b/client/src/Components/Signup.tsx
@@ -1,23 +1,24 @@
import React, { useState } from 'react';
import {Link, useNavigate} from 'react-router-dom';
-import {useSetRecoilState} from "recoil";
-import {authState} from "../store/authState.js";
+import { userParams } from '@shawakash/common2';
-const Signup = () => {
- const [username, setUsername] = useState('');
- const [password, setPassword] = useState('');
+const Signup: React.FC = () => {
+ const navigate = useNavigate();
+ const [username, setUsername] = useState
+
+
+ ✨ https://zod.dev ✨
+ Zod
+
+ TypeScript-first schema validation with static type inference
+
+
+
+
+ + Astro + + astro.build + +
+ Astro is a new kind of static |
+
+
+
+
+ + Glow Wallet + + glow.app + + Your new favorite
+ |
+
+
+
+
+ + Deletype + + deletype.com + |
+
+
+
+
+ + Proxy + + proxy.com + |
+
+
+
+
+ + Trigger.dev + + trigger.dev + |
+
+
+
+
+
+ + Numeric + + numeric.io + |
+
+
+
+
+ + Snaplet + + snaplet.dev + |
+ |
+
+
+
+ + Marcato Partners + + marcatopartners.com + |
+
+
+
+
+ + Interval + + interval.com + |
+
+
+
+
+ + Seasoned Software + + seasoned.cc + |
+
+
+
+
+ + Bamboo Creative + + bamboocreative.nz + |
+
+
+
+
+ + Brandon Bayer + + @flybayer, + creator of Blitz.js + + |
+
+
+
+
+ + Jiří Brabec + + @brabeji + + |
+
+
+
+
+ + Alex Johansson + + @alexdotjs + |
+
+
+
+
+ + Fungible Systems + + fungible.systems + + |
+
+
+
+
+ + Adaptable + + adaptable.io + + |
+
+
+
+
+ + Avana Wallet + + avanawallet.com + Solana non-custodial wallet + + |
+
+
+
+
+ + Jason Lengstorf + + learnwithjason.dev + + |
+
+
+
+
+ + Global Illumination, Inc. + + ill.inc + + |
+
+