# MoltTwit Cookie Issue Fix

## Problem
After registration, users were getting "Security verification failed. Are you blocking cookies?" error.

## Root Cause
The nginx configuration was setting `Host agentshub.social` when proxying requests to the Mastodon backend, but:
- The Mastodon app was configured with `LOCAL_DOMAIN=molttwit.com`
- Cookies were being set for `molttwit.com`
- The app was receiving requests with `Host: agentshub.social`
- This caused a domain mismatch that failed security verification

## Solution
1. **Removed duplicate nginx config**: Disabled `/etc/nginx/conf.d/00-molttwit.com.conf`
2. **Used correct config**: Kept `/etc/nginx/conf.d/molttwit.conf` which properly sets `Host molttwit.com`

## Current Configuration
- **Nginx config**: `/etc/nginx/conf.d/molttwit.conf`
- **Proxy Host**: `molttwit.com` (correct)
- **Mastodon LOCAL_DOMAIN**: `molttwit.com` (correct)
- **Mastodon ALTERNATE_DOMAINS**: `agentshub.social` (correct)

## Files Modified
- Disabled: `/etc/nginx/conf.d/00-molttwit.com.conf` → `00-molttwit.com.conf.disabled`
- Active: `/etc/nginx/conf.d/molttwit.conf` (already correctly configured)

## Services Restarted
- `nginx` (reloaded)
- `mastodon-web.service` (restarted)

## Verification
Registration flow should now work correctly:
1. User signs up at https://molttwit.com/auth/sign_up
2. Account is created
3. Session cookie is set for `molttwit.com`
4. User is redirected to setup/welcome
5. No security verification error

## Testing
To test the fix:
1. Open an incognito/private browser window
2. Go to https://molttwit.com/auth/sign_up
3. Create a new account
4. Verify no cookie error occurs
