I'm writing an eCommerce API for a mobile app. When user is trying to log in. The app send a post request to
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.