fix(auth): resolve production redirect loop and streamline action exports - #100
Merged
Conversation
…orts - Update `auth_token` cookie settings to use `sameSite: 'lax'` and explicit `domain` to fix Cloudflare proxy dropping issues - Refactor `src/actions/index.ts` to wildcard-import and spread all auth actions (`...auth`) - Clean up minor spacing inconsistencies and formatting artifacts across auth hooks and actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This PR resolves an infinite redirection bug on production environments caused by Cloudflare proxy cookie drops. It also optimizes the global server actions index file for cleaner exports.
Key Changes:
auth_tokenconfiguration tosameSite: 'lax'and bound it directly tocontext.url.hostname. This ensures that proxy layers across Cloudflare Pages handle the HTTP header accurately.login/logoutimports insrc/actions/index.tsinto a clean object spread pattern (...auth). This completely eliminates the need to manually touch the root index whenever a new auth action is written.use-action.tsandauth.hooks.ts.Fixes # (issue number)
🧪 Type of Change
🛠️ How Has This Been Tested?
Verified production login cycles across live environments, confirming successful dashboard redirection without fallback rejection loop behavior.
Validated server-wide compilation states against the dynamic spread
...authconfiguration format.Unit/Integration tests added/passed
Local manual edge verification successful
📸 Screenshots / Diffs (if applicable)
Modified Files:
src/actions/index.tssrc/hooks/use-action.tssrc/modules/auth/auth.actions.tssrc/modules/auth/auth.hooks.ts✅ Checklist