0

I'm writing an eCommerce API for a mobile app. When user is trying to log in. The app send a post request to

http://myapi.com/sessions

and my api send this response back;

session_id access_token access_token_expiry refresh_token refresh_token_expiry

Acces token has a short life time like 30 minutes. And refresh token has 30 days life time. My app should check my access token every time i open the app and every request and should refresh my access token. If my refresh token expired too the app should log me out.

How can i do that? I'm new to flutter and coding. Is there any simple way to this authentication process? Thanks for your helps.

  • Check Dio library and this topic: https://stackoverflow.com/questions/56740793/using-interceptor-in-dio-for-flutter-to-refresh-token – dubace Jun 25 '20 at 12:11
  • https://stackoverflow.com/a/63219269/9609442 – Gabe Feb 03 '21 at 01:47

0 Answers0