gotrue-csharp icon indicating copy to clipboard operation
gotrue-csharp copied to clipboard

Autorefresh betweeen sessions not working

Open zalito12 opened this issue 1 year ago • 0 comments

Bug report

Describe the bug

I'm using email+password Auth but I cannot make Autorefresh work.

I don't know if it's a lack of documentation, a problem on my code or I've missed something. But everytime I run my app and 1 hour has passed, the stored session is destroyed and I have to login again.

I haven't tested autorefresh in same session yet, I have to change token expiry time and check it.

Expected behavior

I thought that autorefresh will refresh the token between sessions, so I didn't have to enter my credentials everytime I run the app.

Screenshots

I've implemented a Session Handler similar to the one found in docs: https://github.com/supabase-community/supabase-csharp/wiki/Authorization-with-Gotrue#session-persistence

You can see my implementation here: https://github.com/GonGarce/AvaloniaTodoApp/blob/supabase/AvaloniaTodoApp/Client/SessionHandler.cs

You can see client creation on this file: https://github.com/GonGarce/AvaloniaTodoApp/blob/supabase/AvaloniaTodoApp/Client/SupabaseService.cs

As you can see I set AutoRefreshToken = true and set session handler.

The console information shows up as follows

!--------------LOAD SESSION--------------!
!--------------DESTROY SESSION--------------!
!--------------SAVED SESSION--------------!
[Supabase AUTH]: Loaded session has expired
!--------------DESTROY SESSION--------------!

System information

Creating a desktop app with avalonia.

  • OS: Windows
  • Version of supabase gotrue: 6.0.3

zalito12 avatar Mar 07 '25 15:03 zalito12