Login in Local Setup not working
Describe the bug After frontend setup we can't login with localhost:3000 with osm login
To Reproduce Steps to reproduce the behavior:
- Go to 'fair link on localhost'
- Click on 'login '
- It redirects to the staging server of FAIR.
- staging server gets login but localhost doesn't logged in.
Expected behavior It should logged in with OSM login in FAIR Setup.
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
it would be helpful to show what .env variables setup you have (please make sure not to share sensitive info/tokens)
Hi @omranlm , right now I am using fair-dev url for backend and using only the frontend locally.
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"
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
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 ?
Make sense, feel free to suggest a solution in the documentation and raise a PR