fAIr icon indicating copy to clipboard operation
fAIr copied to clipboard

Login in Local Setup not working

Open varun2948 opened this issue 2 years ago • 6 comments

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 avatar Dec 21 '23 11:12 varun2948

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)

omranlm avatar Dec 21 '23 12:12 omranlm

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

varun2948 avatar Dec 21 '23 14:12 varun2948

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 avatar Dec 21 '23 15:12 omranlm

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

omranlm avatar Dec 21 '23 15:12 omranlm

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 ?

varun2948 avatar Dec 21 '23 15:12 varun2948

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

omranlm avatar Dec 21 '23 15:12 omranlm