From 1d0298e417c3d673fa4edc5278a3a3a53b3140d1 Mon Sep 17 00:00:00 2001 From: Sameer Shaik Date: Tue, 25 Jun 2024 23:45:51 +0530 Subject: [PATCH] authentication --- client/package-lock.json | 29 ++++++++++++++++++++++++ client/package.json | 1 + client/src/components/Authentication.jsx | 11 ++++++++- server/index.js | 12 ++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/client/package-lock.json b/client/package-lock.json index e7586a1..a9a4c3e 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -15,6 +15,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.7.2", "framer-motion": "^11.2.11", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -6808,6 +6809,29 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -16155,6 +16179,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", diff --git a/client/package.json b/client/package.json index cab65b4..d9fee8d 100644 --- a/client/package.json +++ b/client/package.json @@ -10,6 +10,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.7.2", "framer-motion": "^11.2.11", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/client/src/components/Authentication.jsx b/client/src/components/Authentication.jsx index 8d38bfc..d776651 100644 --- a/client/src/components/Authentication.jsx +++ b/client/src/components/Authentication.jsx @@ -1,6 +1,7 @@ import React, { useState } from 'react' import { useNavigate } from "react-router-dom" import "../styles/authentication.css" +import axios from 'axios' export default function Authentication() { const navigate = useNavigate(); @@ -8,7 +9,15 @@ export default function Authentication() { const [password, setPassword] = useState(""); const loginBtn = (e) => { - console.log(email + " " + password) + axios.post("http://localhost:3001/home/login",{ + Email : email, + Password : password + }) + .then(data => console.log(data)) + .error(er => console.log("Error")); + + + navigate("/app") } diff --git a/server/index.js b/server/index.js index e69de29..545ab15 100644 --- a/server/index.js +++ b/server/index.js @@ -0,0 +1,12 @@ +const express = require('express') +const app = express(); + + +// Middle Ware + + + +// Routes + + +// Listen \ No newline at end of file