-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
❌ Deploy Preview for studentzynergy failed.
|
body('email').isEmail().withMessage('Invalid email'), | ||
body('password').notEmpty().withMessage('Password is required') | ||
], | ||
register |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
body('email').isEmail().withMessage('Invalid email'), | ||
body('password').notEmpty().withMessage('Password is required') | ||
], | ||
login |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
], | ||
login | ||
) | ||
router.post('/token', token) |
Check failure
Code scanning / CodeQL
Missing rate limiting High
authorization
There was a problem hiding this 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 :
- add a rate limit when making call with database
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:
Please contact me in case of any bug or issue.