Skip to content

Authentication and Session Management Issues in WebContainer Project #1733

@KenDSD

Description

@KenDSD

Describe the bug

Description
Our website monitoring application deployed on StackBlitz WebContainer is experiencing critical authentication and session management issues that significantly impact user experience and core functionality.

Environment

  • Platform: StackBlitz WebContainer
  • Framework: React with TypeScript
  • Authentication: Supabase
  • Database: Supabase
  • Project URL: https://websitemonitors.top

Issues

1. Monitored URLs Display Issue

Previously entered monitored websites are not displayed when using the "View Monitored URLs" link with a valid email account, despite being properly stored in the database.

2. Session Persistence Issue

The "Sign Out" link is incorrectly displayed on subsequent page visits (not initial page visit), indicating improper session management. This occurs even with explicit session non-persistence configuration.

Steps to Reproduce

Monitored URLs Display Issue

  1. Navigate to websitemonitors.top
  2. Enter one or more URLs
  3. Enable "Monitor Websites"
  4. Configure ping and report frequencies
  5. Enter email address
  6. Click "Ping Websites"
  7. Verify URLs are displayed
  8. Close page
  9. Reopen websitemonitors.top
  10. Click "View Monitored URLs"
  11. Enter the same email address
  12. Expected: Previously monitored URLs should appear
  13. Actual: No URLs are displayed

Session Persistence Issue

  1. Close the page completely
  2. Open websitemonitors.top
  3. On subsequent page visits:
    • Expected: "View Monitored URLs" link visible
    • Actual: "Sign Out" link incorrectly displayed

Technical Implementation

// src/supabase.ts
export const supabase = createClient(supabaseUrl, supabaseKey, {
  auth: {
    persistSession: false,
    autoRefreshToken: false,
    detectSessionInUrl: false
  }
});

Despite explicit configuration to prevent session persistence, the issues persist.

Impact

These issues significantly affect the core functionality of the application:

  1. Users cannot view their monitored URLs without re-adding them
  2. Incorrect session state creates a confusing user experience
  3. Authentication state becomes unreliable between visits

Additional Context

  • The issues appear to be specific to the WebContainer environment
  • Local development testing shows correct behavior
  • All authentication configurations follow recommended practices

Questions

  1. Are there known issues with session management in WebContainer?
  2. Are there specific configurations needed for Supabase authentication in WebContainer?
  3. Is there a recommended approach for handling authentication state in WebContainer?

Attachments

Link to the blitz that caused the error

https://websitemonitors.top

Steps to reproduce

Monitored URLs Display Issue
Navigate to websitemonitors.top
Enter one or more URLs
Enable "Monitor Websites"
Configure ping and report frequencies
Enter email address
Click "Ping Websites"
Verify URLs are displayed
Close page
Reopen websitemonitors.top
Click "View Monitored URLs"
Enter the same email address
Expected: Previously monitored URLs should appear
Actual: No URLs are displayed

Expected behavior

Expected: Previously monitored URLs should appear
Expected: "View Monitored URLs" link visible

Parity with Local

Screenshots

No response

Platform

  • OS: [ChromeOS
  • Browser: [Chrome]
  • Version: [Version 132.0.6834.206 (Official Build) (64-bit)]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions