-2

Good morning,

I have a question in regards to handling JWTokens and how to validate controllers with them.

So far I have a fully functional API, including a login function that creates a Bearer Token and returns it when I make an API call. The idea is to now build a client app that will allow a user to login through the API and then request data from that same API, presumably with the help of the token that was generated when logging in.

Now here comes the problem. So far I have only worked with API calls through Postman, where you simply enter the received token into the auth bearer field and the rest is done automatically. Now that my client needs to make the calls instead, I need somewhere else to store this token, so that my client app will know what token to send with the API call. How and where is the token saved? It feels very redundant to save it in the database seeing as the token is generated based on database information..

Peachy
  • 21
  • 5

1 Answers1

-1

I suggest you can use client's local storage to resolve it. if your client is browser, the Local Storage or Cookies is preferred.