ushahidi / pwa-prototype-reporting

A PWA for reporting only purposes (compatible with ushahidi.io APIs)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get a token for the API

rowasc opened this issue · comments

  • when fetching or posting, check localStorage first

    • if the token exists, you get it and send it in the headers. The headers will have to be sent in this format "Authorization: Bearer "
    • if the token does not exist -> make the token request, grab the access_token
      • save the access_token in localStorage
  • When posting a new report or doing any other requests to the API, the headers will have to be sent in this format "Authorization: Bearer "