-
Notifications
You must be signed in to change notification settings - Fork 151
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
Fixed the signup and login issue #255 #272
Conversation
@anuragnegi000 is attempting to deploy a commit to the vansh69's projects Team on Vercel. A member of the Team first needs to authorize it. |
@hustlerZzZ please merge this PR as soon as possible so everyone can Signup |
@hustlerZzZ please add labels too |
Congratulations, Your pull request has been successfully merged 🥳🎉 Thank you for your contribution to the project 🚀 Keep Contributing!! ✨ |
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.
@anuragnegi000 @hustlerZzZ Base URL is hardcoded in alot of places. We need to make sure that it's not hardcoded to localhost
so that API calls are not made to localhost in production. It should be retrieved from .env
file.
We can also create a custom instance of axios with our baseurl
from .env
file
Login API call is still made to localhost

|
||
const response = await axios.post(apiUrl, formData); | ||
// const apiUrl = `${process.env.REACT_APP_BASE_URL}/studentLogin`; | ||
const apiUrl = `http://localhost:3000/api/v1/studentLogin`; |
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.
Base URL should be taken from .env
file
) { | ||
if (formData.accountType === "User") { | ||
// const apiUrl = `${process.env.REACT_APP_BASE_URL}/studentSignup`; | ||
const apiUrl = `http://localhost:3000/api/v1/studentSignup`; |
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.
Base URL should be taken from .env
file
setLoading(false); | ||
} | ||
} else { | ||
const apiUrl = `http://localhost:3000/api/v1/canteenSignup` |
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.
Base URL should be taken from .env
file
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.
Yes this makes sense
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #255
Type of change
Please give a X on it which is applicable
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test A Describe here
Tested this in localhost and it's working fine now
Test B Describe here (if Requred)
fixesF.mp4
Checklist:
give a X on it which is applicable