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

Fixed the signup and login issue #255 #272

Merged
merged 2 commits into from
Jun 8, 2024

Conversation

anuragnegi000
Copy link
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor Code
  • A documentation update
  • Others(mentioned in the issue number)

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

  • [ X] My code follows the style guidelines of this project
  • [ X] 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
  • [X ] 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
  • Any dependent changes have been merged and published in downstream modules

Copy link

vercel bot commented Jun 8, 2024

@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.

@anuragnegi000
Copy link
Contributor Author

@hustlerZzZ please merge this PR as soon as possible so everyone can Signup

@anuragnegi000
Copy link
Contributor Author

@hustlerZzZ please add labels too

@hustlerZzZ hustlerZzZ added gssoc This label is attached to the issues related to Gssoc'24 level1 labels Jun 8, 2024
@hustlerZzZ hustlerZzZ merged commit 0ec7ce8 into VanshKing30:main Jun 8, 2024
0 of 3 checks passed
Copy link

github-actions bot commented Jun 8, 2024

Congratulations, Your pull request has been successfully merged 🥳🎉 Thank you for your contribution to the project 🚀 Keep Contributing!! ✨

Copy link
Contributor

@aayushchugh aayushchugh left a 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

image


const response = await axios.post(apiUrl, formData);
// const apiUrl = `${process.env.REACT_APP_BASE_URL}/studentLogin`;
const apiUrl = `http://localhost:3000/api/v1/studentLogin`;
Copy link
Contributor

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`;
Copy link
Contributor

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`
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc This label is attached to the issues related to Gssoc'24 level1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Can't Signup
3 participants