Skip to content

Sign-in persistantce #215

@eduardoagr

Description

@eduardoagr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions