authentication-system

Community

Dual-token auth with robust access control.

Authorbkinsey808
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Provides a secure, scalable authentication model that supports both anonymous visitors and authenticated users within a single Supabase-backed system, enabling safe realtime interactions and effective data access controls.

Core Features & Use Cases

  • Two-Token System: Visitor token for anonymous access and User token for authenticated data operations.
  • Single Supabase Auth User: A unified transport layer to support Realtime with proper differentiation via app_metadata.
  • Dynamic JWT Metadata: app_metadata updated to reflect user context for Row Level Security enforcement.
  • Automatic Token Switching: Client automatically selects and caches the appropriate token based on sign-in state.
  • Row Level Security: Fine-grained access controls across public and private data.
  • In-Memory Token Storage: Client-side caching to avoid localStorage and reduce exposure.

Quick Start

Initialize the client to obtain a visitor token for anonymous access, then switch to a user token after sign-in to enable full data access.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: authentication-system
Download link: https://github.com/bkinsey808/songshare-effect/archive/main.zip#authentication-system

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.