What are some common design patterns that communit...
# share-your-work
s
What are some common design patterns that community is following for refreshing tokens?
r
hey @sharma8471 are you implementing your own session refreshing or using supertokens?
s
Using Supertokens
r
well, as a user of supertokens, you shouldnt' really have to care that much about how sessions are refreshed. That happens on its own. if you can give me more context around the question, I can perhaps shed more light.
s
I'm using
supertokens-website
sdk which doesn't have the refresh token mechanism. Which is why I wrote my own mechanism for that. Note: I am doing the server side rendering. It is working but I'm just curious how other people do it. And what would be the best combination of UX+security in this case.
r
That SDK does have the refresh token mechanism
You need to initialise it and it adds interceptors to fetch. If you are using axios, you need to add the interceptor to axios yourself. The interceptor we provide refreshes the session on its own
Did you miss that in the docs? Or rather, what made you think the SDK doesn’t call refresh?
2 Views