Skip to content

Bump next-auth session cookie to v2 - #3587

Merged
Baalmart merged 1 commit into
stagingfrom
ft-vertex-template
Jun 7, 2026
Merged

Bump next-auth session cookie to v2#3587
Baalmart merged 1 commit into
stagingfrom
ft-vertex-template

Conversation

@Codebmk

@Codebmk Codebmk commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary of Changes (What does this PR do?)

  • Rename NextAuth session cookie to include a -v2 suffix in both the NextAuth options and middleware (src/vertex/app/api/auth/[...nextauth]/options.ts and src/vertex/middleware.ts). This rotates the cookie name for production and development to avoid collisions and enable migration to the new cookie version.

Status of maturity (all need to be checked before merging):

  • I've tested this locally
  • I consider this code done
  • This change ready to hit production in its current state
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included issue number in the "Closes #ISSUE-NUMBER" part of the "What are the relevant tickets?" section to link the issue.
  • I've updated corresponding documentation for the changes in this PR.
  • I have written unit and/or e2e tests for my change(s).

How should this be manually tested?

  • Please include the steps to be done inorder to setup and test this PR.

What are the relevant tickets?

Screenshots (optional)

Summary by CodeRabbit

  • Chores
    • Updated authentication session configuration with improved cookie handling to enhance security and reliability across production and non-production environments.

Rename NextAuth session cookie to include a -v2 suffix in both the NextAuth options and middleware (src/vertex/app/api/auth/[...nextauth]/options.ts and src/vertex/middleware.ts). This rotates the cookie name for production and development to avoid collisions and enable migration to the new cookie version.
@Codebmk
Codebmk requested a review from Baalmart June 7, 2026 17:15
@Codebmk Codebmk self-assigned this Jun 7, 2026
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d8903cf-734e-4d44-b319-99420fd94987

📥 Commits

Reviewing files that changed from the base of the PR and between 0ba6034 and 1248354.

📒 Files selected for processing (2)
  • src/vertex/app/api/auth/[...nextauth]/options.ts
  • src/vertex/middleware.ts

📝 Walkthrough

Walkthrough

This PR upgrades the NextAuth session cookie name to a v2 variant across authentication configuration and middleware. The cookie name changes from __Secure-next-auth.session-token / next-auth.session-token to their -v2 equivalents in production and non-production respectively, ensuring consistent cookie handling throughout the application.

Changes

Session Cookie v2 Upgrade

Layer / File(s) Summary
Session token cookie name upgrade to v2
src/vertex/app/api/auth/[...nextauth]/options.ts, src/vertex/middleware.ts
Auth options and middleware update the session token cookie name to use the -v2 variant in both production (__Secure-next-auth.session-token-v2) and non-production (next-auth.session-token-v2) environments.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🍪 A cookie grows from v1 to v2,
Secure and sweet in all we do,
Auth and middleware dance as one,
Session tokens—version two is spun! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: updating the NextAuth session cookie name to a v2 variant across both configuration and middleware files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ft-vertex-template

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

New azure vertex changes available for preview here

@Codebmk
Codebmk marked this pull request as draft June 7, 2026 17:22
@Codebmk
Codebmk marked this pull request as ready for review June 7, 2026 17:24
@Baalmart
Baalmart merged commit b98de37 into staging Jun 7, 2026
28 checks passed
@Baalmart
Baalmart deleted the ft-vertex-template branch June 7, 2026 17:28
@Baalmart Baalmart mentioned this pull request Jun 7, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants