Saurav Biswas
TTCTheo's Typesafe Cult
•Created by Saurav Biswas on 4/9/2024 in #questions
How can I implement JWT access/refresh token flow with trpc
Lets say the access token has expiry of 1d and refresh token of 7d. When the access token expires the server will return 401 and will request for new access token. If it's past 7 days of login, the app should log out the user.
Usually with axios I create an axios interceptor.
What's the ideal way to do that in trpc. Any example of working code would be highly appreciated.
Thanks!
8 replies