supabase-auth-flow

Manage Supabase authentication and session state with Riverpod and go_router.

1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/code-sinobi/hoya-time-travel --skill supabase-auth-flow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-auth-flow
Source: https://github.com/code-sinobi/hoya-time-travel/tree/main/.agent/skills/supabase-auth-flow
Command: npx skills add https://github.com/code-sinobi/hoya-time-travel --skill supabase-auth-flow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manages authentication and session state for apps using Supabase, Riverpod, and go_router, providing a centralized source of truth and safe routing decisions.

Core Features & Use Cases

  • Centralized auth state with Supabase as the single source of truth
  • Exposes authSessionProvider and currentUserProvider for UI access
  • go_router integration with redirect guards to protect routes
  • Handles login/logout flows and session changes with minimal boilerplate
  • Anti-patterns and best-practices guidance for secure auth integration

Quick Start

Wire up the auth providers and router in your app to enable login, session management, and protected routes.

Frequently Asked Questions about supabase-auth-flow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage Supabase authentication state reactively in a Flutter app?

Protect go_router routes in Flutter by wiring redirect guards that check the Supabase auth session provider. The router evaluates the authentication state before navigation, automatically redirecting unauthenticated users to the login screen and preventing access to protected routes.

What's the best way to handle Flutter login and logout flows with Riverpod and Supabase?

Handle Flutter login and logout flows by invoking Supabase auth methods and letting the centralized Riverpod session provider react to the changes. This approach minimizes boilerplate by automatically updating the global auth state and triggering go_router redirects without manual state resets.

How do I access the current Supabase user data across different Flutter widgets?

Access the current Supabase user data across Flutter widgets by reading the exposed currentUserProvider. This Riverpod provider derives from the underlying Supabase session provider, ensuring your UI consistently retrieves the authenticated user's profile data without direct Supabase client calls.

Why does my Flutter app lose the Supabase session after a hot restart?

Your Flutter app may lose the Supabase session after a hot restart if the session provider is not properly initialized from Supabase's persistent storage. A secure auth flow restores the session by checking the initial Supabase client state before building the go_router configuration.