Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added backend authendication using Mongo node and express #341

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

Abhishek-TG18
Copy link
Contributor

Pull Request Format

PR Title

Issue #314 : Implement Authentication using MongoDB, Node.js, and Express.js [backend] solved

Type of PR

  • Add X in the box to specify the improvement type.
  • [] Bug fix
  • [ x] Feature enhancement
  • Documentation update
  • [x ] BackendUpdate

Description

This pull request includes the implementation of the backend functionality for user authentication and management. The following features have been added:

  • #Signup: Users can register with their email and password. The server validates the input and stores the user information in the database.
  • #Sign-in: Registered users can log in by providing valid credentials.
  • #User Details: Once logged in, users can retrieve their account information from the database.
  • #Signout: Users can securely log out of their accounts.

All routes and logic have been implemented and tested with Postman. Please review and merge.

Checklist

  • Add X in the box to specify.
  • I have performed a self-review of my code.
  • x[ ] I have tested the changes thoroughly before submitting this pull request.
  • I have provided relevant issue numbers, screenshots, and videos after making the changes.
  • [x ] I have commented my code, particularly in hard-to-understand areas.

Information to Start the server

image
image

Feel free to ask if you have any doubt

I have tested the code using Postman API Testing here are the demo videos

Post.data.-.My.Workspace.-.Google.Chrome.2024-10-02.16-33-19.mp4
Post.data.-.My.Workspace.-.Google.Chrome.2024-10-02.16-32-32.mp4
Get.data.-.My.Workspace.-.Google.Chrome.2024-10-02.16-48-36.mp4
Get.data.-.My.Workspace.-.Google.Chrome.2024-10-02.16-48-10.mp4

Thank you for reviewing my pull request!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, @Abhishek-TG18! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our contributing guidelines

Copy link

netlify bot commented Oct 8, 2024

Deploy Preview for rococo-mooncake-0d89f7 ready!

Name Link
🔨 Latest commit e576bf1
🔍 Latest deploy log https://app.netlify.com/sites/rococo-mooncake-0d89f7/deploys/67052f94faef600008fa64f0
😎 Deploy Preview https://deploy-preview-341--rococo-mooncake-0d89f7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

backend/controller/authController.js Dismissed Show dismissed Hide dismissed

const signUp = async (req, res, next) => {
const { name, email, password, confirmPassword } = req.body;
console.log(name , email,password,confirmPassword)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This logs sensitive data returned by
an access to password
as clear text.

const signUp = async (req, res, next) => {
const { name, email, password, confirmPassword } = req.body;
console.log(name , email,password,confirmPassword)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This logs sensitive data returned by
an access to confirmPassword
as clear text.

const signIn = async (req, res, next) => {
const { email, password } = req.body;
console.log(email,password)

Check failure

Code scanning / CodeQL

Use of externally-controlled format string High

Format string depends on a
user-provided value
.

const signIn = async (req, res, next) => {
const { email, password } = req.body;
console.log(email,password)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This logs sensitive data returned by
an access to password
as clear text.
Comment on lines +92 to +94
.findOne({
email
})

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
} = require("../controller/authController.js");

authRouter.post("/signup", signUp);
authRouter.post("/signin", signIn);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.
authRouter.post("/signin", signIn);


authRouter.get("/user", jwtAuth, getUser);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
authRouter.post("/signin", signIn);


authRouter.get("/user", jwtAuth, getUser);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.


authRouter.get("/user", jwtAuth, getUser);
authRouter.get("/logout", jwtAuth, logout);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
@Anjaliavv51
Copy link
Owner

@Abhishek-TG18 i need to implement those methods mentioned in video by u right?

@Anjaliavv51
Copy link
Owner

www.linkedin.com/in/lakshmi-pavananjali-pamidi-766760296

please ping me in linkedin

@Anjaliavv51
Copy link
Owner

@Abhishek-TG18 code scanning results shows failed y?

@Anjaliavv51 Anjaliavv51 merged commit 0fab530 into Anjaliavv51:main Oct 15, 2024
6 of 7 checks passed
Copy link

🎉 Your pull request has been successfully merged! 🎉 Thank you for your contribution to our project. Your efforts are greatly appreciated. Keep up the fantastic work! 🚀

@Anjaliavv51
Copy link
Owner

@Abhishek-TG18 our repo is of files HTML CSS JS only

image

in the above pic , main is index.js

@Abhishek-TG18
Copy link
Contributor Author

@Abhishek-TG18 code scanning results shows failed y?

DON'T worry. That I have console some information related to sign in
During connecting to front end I will remove those

@Abhishek-TG18
Copy link
Contributor Author

Please once see LinkedIn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants