Skip to content

Conversation

@miurla
Copy link
Owner

@miurla miurla commented Dec 17, 2025

Summary

  • Remove client-side authentication check that was blocking message submission when ENABLE_AUTH=false
  • Add Sign Up/Sign In buttons to ErrorModal for server-side auth errors (401)

Problem

When running Docker with ENABLE_AUTH=false, users were incorrectly prompted to log in when trying to send a message. The server-side getCurrentUserId() already properly handles anonymous mode, but the client-side useAuthCheck hook was checking Supabase session only, unaware of the ENABLE_AUTH setting.

Solution

Remove the client-side pre-check and rely on server-side authentication. When the server returns 401, the ErrorModal now shows Sign Up/Sign In buttons instead of just a Close button.

Scenario Before After
ENABLE_AUTH=false (Docker) AuthModal shown (bug) Request sent, works ✅
ENABLE_AUTH=true + unauthenticated AuthModal shown Request → 401 → ErrorModal with Sign In/Sign Up

Test plan

  • Docker with ENABLE_AUTH=false: Can send messages without login prompt
  • Vercel with ENABLE_AUTH=true: Unauthenticated users see ErrorModal with Sign In/Sign Up buttons

Closes #756

🤖 Generated with Claude Code

Remove the client-side authentication check that was blocking message
submission when ENABLE_AUTH=false. The server-side auth handling in
getCurrentUserId() already properly supports anonymous mode, but the
client-side useAuthCheck hook was not aware of this setting.

Changes:
- Remove useAuthCheck hook and AuthModal from chat.tsx
- Add Sign Up/Sign In buttons to ErrorModal for auth errors
- Server 401 responses now show ErrorModal with login options

This fixes the issue where Docker deployments with ENABLE_AUTH=false
would incorrectly prompt users to log in.

Closes #756

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
morphic Ready Ready Preview, Comment Dec 17, 2025 3:50am

@miurla miurla linked an issue Dec 17, 2025 that may be closed by this pull request
2 tasks
@miurla miurla merged commit 6979efb into v1.0.0 Dec 17, 2025
8 checks passed
@miurla miurla deleted the fix/docker-auth-check branch December 17, 2025 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] V1.0.0 Bug

1 participant