0

I need one help related to Auth Token Expiry. I have one access token whose expiry is 30 minutes. As I am used doing something/some activity till 30 minutes . Now my token expired , at 30th minutes I called the service to fetch all users but at this time my tokes was expired . So how to handle this situation. 1. Do i allow the application to fetch the users List with expired token ? 2. Should I regenerate the token sent back to browser ,stored in LocalStorage and call the service again.?

Note: While doing this User should not know that application token expired.This all should be done in Asynchronous manner.

Thanks, Rahul

rahulnikhare
  • 1,362
  • 1
  • 18
  • 25

1 Answers1

0

Are you using a refresh token? What you need is an API interceptor which can catch the 403 error response and can request for a new token using the refresh token that you have stored. You can then trigger the request again using the new token.

Anoopkr05
  • 73
  • 1
  • 6
  • No. I am not using refresh token. THe situation is i need to do 2 task is 1. update/generate/refresh the token and 2. also cater the user request. This both thing should be handle in one click only. – rahulnikhare Apr 24 '18 at 08:18