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

Login in Local Setup not working #191

Open
varun2948 opened this issue Dec 21, 2023 · 6 comments
Open

Login in Local Setup not working #191

varun2948 opened this issue Dec 21, 2023 · 6 comments
Labels
bug Something isn't working component : frontend good first issue Issues that welcome contributions priority:low

Comments

@varun2948
Copy link

varun2948 commented Dec 21, 2023

Describe the bug
After frontend setup we can't login with localhost:3000 with osm login

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'fair link on localhost'
  2. Click on 'login '
  3. It redirects to the staging server of FAIR.
  4. staging server gets login but localhost doesn't logged in.

Expected behavior
It should logged in with OSM login in FAIR Setup.

image

@varun2948 varun2948 added the bug Something isn't working label Dec 21, 2023
@omranlm
Copy link
Contributor

omranlm commented Dec 21, 2023

Thanks for raising the issue @varun2948, May I have more info as the following?

I am assuming your are using the backend API locally and have the back end setup locally and have the front end .env variable REACT_APP_API_BASE referencing to your local backend correctly

Then, in the backend .env variables
did you get a new OSM_CLIENT_ID, OSM_CLIENT_SECRET and have already OSM_URL=https://www.openstreetmap.org

Those OSM_CLIENT_ID, OSM_CLIENT_SECRET can come from your own account here https://www.openstreetmap.org/oauth2/applications
and Redirect URIs as shown below
image

it would be helpful to show what .env variables setup you have (please make sure not to share sensitive info/tokens)

@varun2948
Copy link
Author

Hi @omranlm ,
right now I am using fair-dev url for backend and using only the frontend locally.

@omranlm
Copy link
Contributor

omranlm commented Dec 21, 2023

Ohh got it now.
It won't work initially as the redirect would go to official fair-dev.hotosm.org link
However, there is a tiny hack around it by logging in on fair-dev and then get your token from your browser application/local storage and use the key as "token"

@omranlm
Copy link
Contributor

omranlm commented Dec 21, 2023

If it didn't word straight forward feel free to pick up a time in my calendar and I can help you in that quickly. I am doing the same scenario for development as well.
https://calendar.app.google/64iWto7TrnLCFk5X6

@varun2948
Copy link
Author

yeah with @kshitijrajsharma guidance i did the same but we might need to add it to the documentation or maybe have some other workaround or something what do you think ?

@omranlm
Copy link
Contributor

omranlm commented Dec 21, 2023

Make sense, feel free to suggest a solution in the documentation and raise a PR

@omranlm omranlm assigned omranlm and unassigned omranlm Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component : frontend good first issue Issues that welcome contributions priority:low
Projects
None yet
Development

No branches or pull requests

2 participants