Skip to content

fix(auth): drop explicit cookie domain to resolve edge deployment drops - #103

Merged
saifulalomdev merged 1 commit into
mainfrom
features
Jun 17, 2026
Merged

fix(auth): drop explicit cookie domain to resolve edge deployment drops#103
saifulalomdev merged 1 commit into
mainfrom
features

Conversation

@saifulalomdev

Copy link
Copy Markdown
Owner

📝 Description

This PR resolves the core production authentication failure where the browser completely failed to write the session cookie.

Key Changes:

  • Removed Domain Strictness: Stripped out the explicit domain: context.url.hostname configuration constraint from the auth_token cookie properties. This prevents Cloudflare Pages proxy routes from causing cross-domain cookie rejections, allowing the browser to fall back to natural matching rules on your live custom domain.
  • Comment Optimization: Cleaned up redundant text commentary in the credentials logic and restored explicit duration annotations for internal readability.

Fixes # (issue number)

🧪 Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor / Chore (codebase maintenance or optimization)

🛠️ How Has This Been Tested?

  • Verified that removing the explicit domain declaration allows modern browser security engines to safely set the context token header automatically under the root origin.

  • Unit/Integration tests added/passed

  • Local manual edge verification successful

📸 Screenshots / Diffs (if applicable)

Modified File: src/modules/auth/auth.actions.ts

✅ Checklist

  • My code follows the brutalist/minimal style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new typescript compiler or linter errors

- Remove explicit `domain` assignment from the `auth_token` cookie configuration
- Allow the browser to fall back to default host origin matching for the custom domain
- Restore the `maxAge` explanatory comment string for structural readability
@saifulalomdev
saifulalomdev merged commit 9c5cbfa into main Jun 17, 2026
1 check passed
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.

1 participant