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

Completed routes in frontend and server setup for login and register functionality #52

Merged
merged 7 commits into from
Aug 7, 2024

Conversation

AmanSingh494
Copy link
Member

Title:

Added routes in frontend and endpoints in backend

Description:

Configuration and setup of server and database. Created functions for sending request to server for login and signin

Related Issue:

Solves issue #36

Changes Made:

Backend -
-Server.js is the main file in the server
-server/db/index.js has db configurations for Postgre sql
-server/routes/auth.js has api endpoints for register, login and token renewal
-server/controllers/authControllers.js has logic for api endpoints
Environment Variables -
The server uses environment variables given below-
-PSQL Setup variables
PORT, PSQLPASSWORD, PSQLUSER, PSQLHOST, PSQLPORT, PSQLDATABASE
CLIENT_URL (frontend url for cors)
ACCESS_TOKEN_SECRET
REFRESH_TOKEN_SECRET

Frontend -
-config.js - contains backend url for requests
-api.js - contains requests functions for login, register
-login.js - function for sending user data to server on submit
-register.js - function for sending user data to server on submit

Checklist:

  • My code follows the code style of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Please contact me in case of any bug or issue.

Copy link

netlify bot commented Aug 1, 2024

Deploy Preview for studentzynergy failed.

Name Link
🔨 Latest commit 46e413c
🔍 Latest deploy log https://app.netlify.com/sites/studentzynergy/deploys/66af17f3ef1c9300087951a4

@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed core tests config labels Aug 1, 2024
body('email').isEmail().withMessage('Invalid email'),
body('password').notEmpty().withMessage('Password is required')
],
register

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.
body('email').isEmail().withMessage('Invalid email'),
body('password').notEmpty().withMessage('Password is required')
],
login

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.
],
login
)
router.post('/token', token)

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
Copy link
Member

@4darsh-Dev 4darsh-Dev left a comment

Choose a reason for hiding this comment

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

@AmanSingh494 ,
Few changes are required :

  1. add a rate limit when making call with database

@4darsh-Dev 4darsh-Dev merged commit 01c56d9 into solve-ease:main Aug 7, 2024
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working config core documentation Improvements or additions to documentation help wanted Extra attention is needed tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants