How can I check if the auth refresh token has expired when the server restarts?

Hello all
When Nakama restart, current user session on Unity client will throw exception: auth token invalid when communicate with Nakama.
How can i detect and resolve this issue and have a seamless user experience ?

Hey @kafka, great question.

I’m assuming you’re talking about your refresh token since those will invalidate when the server responds.

What you’ll want to do is check if the refresh token has expired using session.IsRefreshExpired. You’ll then need to ask the user to reauthenticate.

1 Like