Sign-in persistantce

Open
#215 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp

Research direction

Start by reviewing Client.RefreshToken and SignInWithEmailAndPassword, along with the reported SecureStorage workaround, to understand the current session flow in .NET MAUI. Define how valid sessions should be persisted, restored, and refreshed across app restarts, then verify that developers no longer need to store credentials or re-authenticate manually.

Written by the indexing model from the issue text.

Description

feature

Feature request

Is your feature request related to a problem? Please describe.
I'm using Supabase in a .NET MAUI application, and currently there's no built-in way to persist the user session across app restarts. This creates friction in the user experience, as I have to manually store the user's email and encrypted password in SecureStorage and re-authenticate using SignInWithEmailAndPassword every time the app launches. I attempted to use Client.RefreshToken, but this method doesn’t accept any parameters and doesn’t restore the session as expected.

A clear and concise description of what you want and what your use case is.

Describe the solution you'd like

I propose introducing a UserRepository abstraction that can be registered with the MAUI dependency injection system. This repository would internally handle session persistence, token refresh, and automatic re-authentication — similar to how FirebaseDatabase.net manages user state. The goal is to make session management seamless for developers, so they don’t have to manually store credentials or manage refresh logic. The library should automatically restore the session if a valid token is available.

A clear and concise description of what you want to happen.

Describe alternatives you've considered

  • Manually storing email and encrypted password in SecureStorage and calling SignInWithEmailAndPassword on app launch.
  • Attempting to use Client.RefreshToken, which currently lacks the necessary parameters or behavior to restore a session.
  • Building a custom wrapper around Supabase client to simulate session persistence, which adds unnecessary complexity and maintenance overhead.

Additional context

This feature would greatly improve developer experience and app security by abstracting session management. It aligns with best practices seen in other libraries like Firebase, and would make Supabase more accessible for MAUI developers building production-grade apps.

Add any other context or screenshots about the feature request here.

Dominant language
C#
Stars
701
Forks
106
Avg merge
16h 35m
Merged PRs (30d)
45

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/supabase-csharp

All issues in supabase/supabase-csharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.