2

I am trying to create a Flutter application with Jwt token authentication. I have referred this article as a starting point. But I want to refresh the tokens on like 15 minutes. So I don't think this article makes sense and also I want to add state management to this as well. I was thinking about Bloc or provider. Some help with implementing this.

Preethi R
  • 41
  • 1
  • 3

1 Answers1

1

Save the token in your local storage and use background_fetch to check the token expiration date (timestamp) after decoding it with this simple snippet code. If time the token is expired the call refresh_token api url

gausoft
  • 91
  • 1
  • 8