Skip to content

Add auth header to API calls done after signin #17

Description

@snehmatic

Header to be added Authorization with value Bearer <access_token>
The access token would be generated by the server after a successful login. The login API's response looks like the below for now(might change later). We should get these tokens from the JSON, store them in local storage, and use them in the next API calls.

{
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTcwOTkwMjk2NiwiaWF0IjoxNzA5ODE2NTY2LCJqdGkiOiIzMzVkNDg4ZTJiZTE0MGEzOTE5MjRlMWE5MmZiNGM2MCIsInVzZXJfaWQiOjIyfQ.yx7MJbrez_b7HbtY80vLRs7pmg_d0DHvkk2_SxYE_cY",
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA5ODE3NDY2LCJpYXQiOjE3MDk4MTY1NjYsImp0aSI6IjgxNGE5NGM4MzI2NTQ2YjBhZWNjMGJhM2Y4NzIxMDkzIiwidXNlcl9pZCI6MjJ9.LysyNiP6-7KD0FCVeTgBBqxDtI6BdR3qq434RkMrcHk"
}

JWT ref: https://auth0.com/docs/secure/tokens/json-web-tokens

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions