supabase-community/gotrue-csharp

AutoRefreshToken problem

kienns1996 opened this issue · 2 comments

Bug report

Describe the bug

No exception is thrown when RefreshToken fails using the AutoRefreshToken = true option

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Log in to 2 clients (Can set Access token (JWT) expiry time = 30 to avoid waiting).
  2. After logging in, log out at one of the 2 clients.
  3. Sessions that are not required to be logged out will continue to run until the token is automatically refreshed and there will be no exceptions or notifications even if they fail. CurrentSession still exists but no more Api calls are made.

System information

  • OS: Windows 11 23H2
  • Version of gotrue-csharp: 5.0.1

I'm a little confused on the third item of your list:

  1. Sessions that are not required to be logged out will continue to run until the token is automatically refreshed and there will be no exceptions or notifications even if they fail. CurrentSession still exists but no more Api calls are made.

Is the problem that the RefreshTimer continues running even after logout? Or that the RefreshTimer doesn't throw an exception?

Would it be possible for you to add a debug logger and include that in a comment?

Something like:

client.AddDebugListener(((s, exception) =>
{
    Debug.WriteLine($"Client 1: {s}");
}));

Log in to the same account at client 1 and client 2, then log out at client 1 and wait until client 2 automatically refreshes the token. Sorry for my English and explanation, I will try to log it and post it here