Skip to content

Login with RefreshToken Crashes #48

Discussion options

You must be logged in to vote

@ConnorIllingworth the method you're using to authenticate should work... at least provided the token is still valid! You could call Client.Auth.GetUser(token) to verify that the token is still valid (returns a user without exception).

However, you might want to look at providing a SessionHandler to the supabase client - it will handle all of this for you!

For example:

Main.cs

var options = new SupabaseOptions
{
    AutoRefreshToken = true,
    AutoConnectRealtime = true,
    SessionHandler = new SupabaseSessionHandler()
};
var client = new Supabase.Client(supabaseUrl, supabaseKey, options);
await supabase.InitializeAsync(); // <-- Will retrieve saved session and set it accordingly.

Supab…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ConnorIllingworth
Comment options

@acupofjose
Comment options

Answer selected by ConnorIllingworth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants