feat(auth): implement __Secure and __Host cookies#10
Merged
halvaradop merged 3 commits intomasterfrom Nov 20, 2025
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 pull request implements secure cookies across all authentication workflows of the library, including:
signIn,callback,session, andsignOut— the currently supported endpoints in Aura Auth.These security prefixes follow modern standards and provide additional guarantees beyond regular cookie options. They also offer compatibility benefits for older browser user-agents, as described in the HTTP State Management Mechanism specification. The prefixes inform the browser how the cookie must be treated, both in client-to-server and server-to-client communication.
Supported Prefixes
__Secure-— Indicates that the cookie must be sent only over secure contexts (HTTPS).Read more
__Host-— A stricter variant of__Secure-. Cookies using this prefix:DomainattributePath=/Read more
Cookie Configuration
To support secure cookie behaviors, this PR also adds new cookie configuration options.
Users can customize them under
config.cookies, which accepts the following structure:Explains of CookieOptions
name: The cookie name. Defaults to "aura-stack".flag: Determines the security level of the cookie. Default: "standard".options: The cookie attributes. These are type-sensitive and adapt automatically depending on theflagchosen.Resources
Note
Aura Auth automatically enforces secure cookies whenever a secure HTTPS connection is detected, even if the user manually disables the secure flag. This prevents misconfigurations and ensures safe defaults.