Skip to content

Feature/cross subdomain auth cookies#371

Open
diegoMCampos wants to merge 8 commits into
masterfrom
feature/cross-subdomain-auth-cookies
Open

Feature/cross subdomain auth cookies#371
diegoMCampos wants to merge 8 commits into
masterfrom
feature/cross-subdomain-auth-cookies

Conversation

@diegoMCampos

@diegoMCampos diegoMCampos commented May 11, 2026

Copy link
Copy Markdown

feat(utils): cross-subdomain cookie support for auth tokens

Summary

Adds opt-in support for storing and clearing auth tokens with a configurable cookie domain, so a single login session can be shared across sibling subdomains (e.g. app.example.com ↔ embed.example.com). Driven entirely by a new env var; when unset, behavior is identical to the previous
version.

Motivation

Before this change, setTokenAsync / removeTokenAsync had no way to attach a domain attribute to the cookies they manage. As a result, the auth token was always host-scoped — a user logged in on app.example.com would not be authenticated on embed.example.com, and any iframe widget hosted
on a sibling subdomain required a separate login.

This is a recurring need for products that embed widgets/iframes under a different subdomain of the same parent domain.

Changes

  1. functions/token/setTokenAsync/index.ts — when process.env.NEXT_PUBLIC_AUTH_COOKIE_DOMAIN is set and the caller didn't provide its own domain, the value is merged into the cookie config passed to setCookie. Callers that explicitly set domain keep precedence.
  2. functions/token/removeTokenAsync/index.ts — reads the same env var; when set, calls removeCookie(key, { domain }) so the cookie is actually removed from the domain scope it was written to (browsers won't clear a Domain=.example.com cookie unless domain is passed to Cookies.remove).
    When unset, calls removeCookie(key) exactly as before — preserving call signatures asserted by existing tests.
  3. functions/cookie/index.ts — removeCookie gains an optional second parameter options?: SetCookieOptions, forwarded to ClientCookies.remove. When called without options, behavior is identical to the previous version (no extra argument is passed). The dispatchCookieChange({ type:
    'remove', key }) event continues to fire either way.

Backwards compatibility

  • Zero breaking changes for existing consumers. If NEXT_PUBLIC_AUTH_COOKIE_DOMAIN is not defined, every code path is byte-for-byte identical to the previous behavior:
    • setTokenAsync(key, value) → still setCookie(key, value, undefined)
    • removeTokenAsync(key) → still removeCookie(key) (single argument)
    • removeCookie(key) → still ClientCookies.remove(key) (single argument, matches existing test in functions/cookie/tests/cookie.test.ts)
  • The new second parameter on removeCookie is optional. No downstream consumer needs to update calls.

How to enable cross-subdomain auth in a downstream app

Set the env var in the consumer app's deploys:

NEXT_PUBLIC_AUTH_COOKIE_DOMAIN=.example.com

Login will then write Authorization / Refresh cookies with Domain=.example.com, and logout will clear them on the same scope. Any sibling *.example.com host can read the session without a second login.

For local testing, the consumer app can wire this up against *.localhost (works without /etc/hosts edits — browsers auto-resolve *.localhost to 127.0.0.1).

Test plan

  • Unit tests in functions/token/setTokenAsync/tests — pass.
  • Unit tests in functions/token/removeTokenAsync/tests — pass.
  • Unit tests in functions/cookie/tests — pass (the removeCookie test asserts toHaveBeenCalledWith(key) with exactly one argument, which is preserved by the conditional branch when no options is passed).
  • Manually verified end-to-end on a downstream app: login on https://main.localhost → Authorization cookie has Domain: .main.localhost → opening https://child.main.localhost in another tab carries the same cookie, page loads authenticated → logout clears the cookie on both hosts.

Summary by CodeRabbit

  • Improvements
    • Enhanced cookie and token handling with configurable domain support, enabling better cross-domain authentication management through environment-based configuration.

@changeset-bot

changeset-bot Bot commented May 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2188433

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR updates cookie handling functions to support environment-based domain configuration. The removeCookie function accepts an optional SetCookieOptions parameter, enabling callers to specify cookie domain. Both setTokenAsync and removeTokenAsync now read NEXT_PUBLIC_AUTH_COOKIE_DOMAIN and conditionally pass it to the underlying cookie functions on non-mobile platforms.

Changes

Auth Cookie Domain Configuration

Layer / File(s) Summary
Cookie removal signature
packages/utils/functions/cookie/index.ts
removeCookie now accepts optional SetCookieOptions parameter and conditionally forwards it to ClientCookies.remove(key, options) or ClientCookies.remove(key). Event dispatch and error handling remain unchanged.
Token setting with domain configuration
packages/utils/functions/token/setTokenAsync/index.ts
setTokenAsync conditionally injects domain from process.env.NEXT_PUBLIC_AUTH_COOKIE_DOMAIN into the cookie config when config.domain is not provided, then passes the merged config to setCookie.
Token removal with domain configuration
packages/utils/functions/token/removeTokenAsync/index.ts
removeTokenAsync reads process.env.NEXT_PUBLIC_AUTH_COOKIE_DOMAIN and conditionally passes { domain: cookieDomain } to removeCookie on non-mobile platforms, otherwise calls removeCookie(key) without options.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 Three cookie functions dance with grace,
Domain whispers from env embrace,
Token set and token gone,
Now with domain, they march as one! 🍪

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding cross-subdomain auth cookie support.
Description check ✅ Passed The description is comprehensive with clear sections covering summary, motivation, changes, backwards compatibility, and test plan.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/cross-subdomain-auth-cookies

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/utils/functions/token/removeTokenAsync/index.ts`:
- Line 21: The console error message in removeTokenAsync is incorrect; change
the log in the catch block to indicate removal rather than setting. Update the
console.error call inside removeTokenAsync to something like "Failed to remove
token for ${key}:" and include the error object (use the existing key and error
variables) so the message accurately reflects the removeTokenAsync operation.
- Around line 13-18: The removeTokenAsync implementation only forwards domain to
removeCookie which breaks removal when a custom path was used; update
removeTokenAsync to accept the same optional config?: CookieAttributes as
setTokenAsync and forward that full config (including path, domain, and any
other attributes) to removeCookie instead of only passing domain—use the
existing function/removeCookie(key, config) call pattern so removeTokenAsync
mirrors setTokenAsync behavior and ensures cookies set with a custom path are
removed correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d397a787-e1ad-4283-a3b0-6b0da9456f79

📥 Commits

Reviewing files that changed from the base of the PR and between 6cb136a and c145193.

📒 Files selected for processing (3)
  • packages/utils/functions/cookie/index.ts
  • packages/utils/functions/token/removeTokenAsync/index.ts
  • packages/utils/functions/token/setTokenAsync/index.ts

Comment on lines +13 to +18
const cookieDomain = process.env.NEXT_PUBLIC_AUTH_COOKIE_DOMAIN
if (cookieDomain) {
removeCookie(key, { domain: cookieDomain })
} else {
removeCookie(key)
}

@coderabbitai coderabbitai Bot May 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify if setTokenAsync is called with custom path configurations

# Search for setTokenAsync calls with config parameter
rg -n -B2 -A5 'setTokenAsync\s*\(' --type=ts | rg -A5 'path'

# Search for any cookie path configurations in token-related code
rg -n 'path.*:' --type=ts -g '*token*'

# Check if there are any cookie configurations that specify paths
ast-grep --pattern $'setTokenAsync($_, $_, { $$$ path: $_ $$$ })'

Repository: silverlogic/baseapp-frontend

Length of output: 221


🏁 Script executed:

#!/bin/bash
# First, locate token-related files
fd 'token' --type f packages/utils/functions/ 2>/dev/null | head -20

# Check the removeTokenAsync file mentioned in the review
cat -n packages/utils/functions/token/removeTokenAsync/index.ts 2>/dev/null

# Look for setTokenAsync
fd -n setTokenAsync packages/utils/ 2>/dev/null
fd -n setTokenAsync . --type f 2>/dev/null | grep -E '\.(ts|tsx|js)$' | head -10

Repository: silverlogic/baseapp-frontend

Length of output: 1368


🏁 Script executed:

#!/bin/bash
# Find setTokenAsync implementation
find packages/utils/functions/token -name 'setTokenAsync' -o -name 'setTokenAsync.ts' 2>/dev/null

# Look for the main setTokenAsync file (not test)
cat -n packages/utils/functions/token/setTokenAsync/index.ts 2>/dev/null

# Check the removeCookie function to understand its signature
find packages/utils -name 'cookie*' -type f 2>/dev/null | grep -v test
cat -n packages/utils/functions/cookie/index.ts 2>/dev/null || cat -n packages/utils/functions/cookie/removeCookie.ts 2>/dev/null

Repository: silverlogic/baseapp-frontend

Length of output: 4676


Pass cookie path to removeCookie to match setTokenAsync behavior.

When removing cookies with js-cookie, both domain and path must match the values used when setting the cookie. setTokenAsync accepts config?: CookieAttributes and passes it to setCookie (including any custom path), but removeTokenAsync only passes domain to removeCookie, ignoring any path that may have been set. This creates an asymmetry where cookies set with a custom path cannot be properly removed.

removeTokenAsync should accept and forward configuration matching setTokenAsync's signature, ensuring path (and other attributes) are preserved during removal.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/utils/functions/token/removeTokenAsync/index.ts` around lines 13 -
18, The removeTokenAsync implementation only forwards domain to removeCookie
which breaks removal when a custom path was used; update removeTokenAsync to
accept the same optional config?: CookieAttributes as setTokenAsync and forward
that full config (including path, domain, and any other attributes) to
removeCookie instead of only passing domain—use the existing
function/removeCookie(key, config) call pattern so removeTokenAsync mirrors
setTokenAsync behavior and ensures cookies set with a custom path are removed
correctly.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipped. Verified all current callers of setTokenAsync in the monorepo (refreshAccessToken, useLogin x2, profile/utils, useAuthMiddleware); the only attribute passed is secure, which is not part of the cookie identifier used by Cookies.remove. The current domain-only forward is sufficient for every real call site today and for the cross-subdomain auth use case this PR enables. The reviewer's principle is correct (full symmetry would be needed if any caller used a custom path), but applying now adds an API surface with no concrete consumer. Can revisit when a downstream needs it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diegoMCampos, understood — that's a thorough and well-reasoned audit. Since all current callers only pass secure (which isn't part of the cookie identifier and thus irrelevant to removal), the domain-only forward covers every real case today. Acknowledging the skip.

(ᴗ_ ᴗ。) Noted for future reviews — if a caller ever introduces a custom path, full config forwarding will be needed at that point.


✏️ Learnings added
Learnt from: diegoMCampos
Repo: silverlogic/baseapp-frontend PR: 371
File: packages/utils/functions/token/removeTokenAsync/index.ts:13-18
Timestamp: 2026-05-11T14:05:39.718Z
Learning: In `packages/utils/functions/token/removeTokenAsync/index.ts` (silverlogic/baseapp-frontend), the decision to forward only `domain` (not the full `CookieAttributes` config) to `removeCookie` was deliberate. All current callers of `setTokenAsync` (refreshAccessToken, useLogin x2, profile/utils, useAuthMiddleware) only pass the `secure` attribute, which is not part of the cookie identifier used by `Cookies.remove` and therefore does not affect removal correctness. Full config forwarding (e.g., custom `path`) was deferred until a downstream consumer actually needs it.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

}
}
} catch (error) {
console.error(`Failed to set token for ${key}:`, error)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the error message.

The error message states "Failed to set token" but this function removes tokens, not sets them.

📝 Proposed fix
-    console.error(`Failed to set token for ${key}:`, error)
+    console.error(`Failed to remove token for ${key}:`, error)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.error(`Failed to set token for ${key}:`, error)
console.error(`Failed to remove token for ${key}:`, error)
🧰 Tools
🪛 GitHub Check: Build and Lint Packages

[warning] 21-21:
Unexpected console statement

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/utils/functions/token/removeTokenAsync/index.ts` at line 21, The
console error message in removeTokenAsync is incorrect; change the log in the
catch block to indicate removal rather than setting. Update the console.error
call inside removeTokenAsync to something like "Failed to remove token for
${key}:" and include the error object (use the existing key and error variables)
so the message accurately reflects the removeTokenAsync operation.

@diegoMCampos

Copy link
Copy Markdown
Author

Quality Gate Passed Quality Gate passed

Issues 1 New issue 0 Accepted issues

Measures 0 Security Hotspots 0.0% Coverage on New Code 0.0% Duplication on New Code

See analysis details on SonarQube Cloud

skipped. I'm don't touch pre-existing code in the baseapp-frontend submodule, I'm keep the PR strictly to what our work introduced

@Janekk Janekk force-pushed the feature/cross-subdomain-auth-cookies branch from c145193 to fa05632 Compare May 14, 2026 18:02
@matheusysd

Copy link
Copy Markdown
Contributor

@anicioalexandre I think I need yout input here, if someone ever calls setTokenAsync(key, val, { domain:'foo.example.com' }) while NEXT_PUBLIC_AUTH_COOKIE_DOMAIN is set to something else, the remove will hit the wrong domain and the cookie sticks around

I know that today no current caller does this but I think is nice to have this working if needed in the future and it's something we expose

also can we have tests for this new scenario? we have for the default scenario so would be nice to have it, and would be nice to document this new NEXT_PUBLIC_AUTH_COOKIE_DOMAIN usage

@Janekk Janekk force-pushed the feature/cross-subdomain-auth-cookies branch from fa05632 to c78df3b Compare May 20, 2026 10:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/utils/functions/token/removeTokenAsync/index.ts (1)

21-21: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Correct the error message.

The error message states "Failed to set token" but this function removes tokens.

📝 Proposed fix
-    console.error(`Failed to set token for ${key}:`, error)
+    console.error(`Failed to remove token for ${key}:`, error)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/utils/functions/token/removeTokenAsync/index.ts` at line 21, The
error message in removeTokenAsync is wrong — it currently says "Failed to set
token" while the function removes tokens; update the console.error call inside
removeTokenAsync to say "Failed to remove token for ${key}:" (or equivalent
wording) so the log accurately reflects the operation performed by the
removeTokenAsync function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/utils/functions/token/removeTokenAsync/index.ts`:
- Around line 13-18: removeTokenAsync is asymmetric with setTokenAsync: it
always uses NEXT_PUBLIC_AUTH_COOKIE_DOMAIN instead of honoring a caller-provided
domain, so removing cookies written with a custom domain fails; update
removeTokenAsync to accept an optional config parameter (mirror setTokenAsync)
and use config?.domain if provided, otherwise fall back to
process.env.NEXT_PUBLIC_AUTH_COOKIE_DOMAIN, then pass that domain into
removeCookie(key, { domain }) (or removeCookie(key) when none) so removals match
how cookies were set; reference functions: removeTokenAsync, setTokenAsync,
removeCookie, and env var NEXT_PUBLIC_AUTH_COOKIE_DOMAIN.

---

Duplicate comments:
In `@packages/utils/functions/token/removeTokenAsync/index.ts`:
- Line 21: The error message in removeTokenAsync is wrong — it currently says
"Failed to set token" while the function removes tokens; update the
console.error call inside removeTokenAsync to say "Failed to remove token for
${key}:" (or equivalent wording) so the log accurately reflects the operation
performed by the removeTokenAsync function.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c6a4dc5d-0a0a-420f-8818-955a7ffd832b

📥 Commits

Reviewing files that changed from the base of the PR and between fa05632 and c78df3b.

📒 Files selected for processing (3)
  • packages/utils/functions/cookie/index.ts
  • packages/utils/functions/token/removeTokenAsync/index.ts
  • packages/utils/functions/token/setTokenAsync/index.ts

Comment on lines +13 to +18
const cookieDomain = process.env.NEXT_PUBLIC_AUTH_COOKIE_DOMAIN
if (cookieDomain) {
removeCookie(key, { domain: cookieDomain })
} else {
removeCookie(key)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Removal asymmetry when caller provides custom domain.

setTokenAsync allows callers to provide a custom domain in the config that takes precedence over NEXT_PUBLIC_AUTH_COOKIE_DOMAIN (line 55 in setTokenAsync: !config?.domain check). However, removeTokenAsync always uses the env var domain when set and has no way to accept a caller-specified domain.

This creates an asymmetry: if a caller sets a token with a custom domain that differs from the env var, removal will fail because js-cookie requires the domain to match for removal.

Example scenario:

// NEXT_PUBLIC_AUTH_COOKIE_DOMAIN = '.example.com'
setTokenAsync('auth', 'token', { domain: 'custom.example.com' })
// Cookie written with domain=custom.example.com

removeTokenAsync('auth')
// Attempts removal with domain=.example.com
// Cookie remains because domain doesn't match

Per your audit, no current callers pass custom domain (only secure), so this doesn't affect existing code. However, the API allows it, creating a footgun for future callers.

Consider either:

  1. Documenting that custom domains in setTokenAsync are unsupported when the env var is set
  2. Accepting an optional config parameter in removeTokenAsync to mirror setTokenAsync (would need to store or pass the domain somehow)
  3. Warning/erroring in setTokenAsync when caller provides a domain that differs from env var
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/utils/functions/token/removeTokenAsync/index.ts` around lines 13 -
18, removeTokenAsync is asymmetric with setTokenAsync: it always uses
NEXT_PUBLIC_AUTH_COOKIE_DOMAIN instead of honoring a caller-provided domain, so
removing cookies written with a custom domain fails; update removeTokenAsync to
accept an optional config parameter (mirror setTokenAsync) and use
config?.domain if provided, otherwise fall back to
process.env.NEXT_PUBLIC_AUTH_COOKIE_DOMAIN, then pass that domain into
removeCookie(key, { domain }) (or removeCookie(key) when none) so removals match
how cookies were set; reference functions: removeTokenAsync, setTokenAsync,
removeCookie, and env var NEXT_PUBLIC_AUTH_COOKIE_DOMAIN.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
  * Updated project dependencies for improved stability and maintenance.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/silverlogic/baseapp-frontend/pull/376?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm-workspace.yaml`:
- Line 39: Update the PR description to explicitly state why js-cookie was
bumped to "js-cookie: 3.0.7" — indicate that this is the patched release
addressing the HIGH-severity prototype-hijack vulnerability affecting versions
<=3.0.5, cite the upstream release/changelog or CVE reference, confirm upstream
notes that there are no breaking changes for 3.0.7, and note whether the bump
was also intended to support cross-subdomain cookie domain behavior; if
uncertain, verify the changelog or tests and state that the bump is solely a
security fix.
- Line 209: You added qs: ^6.15.2 to pnpm-workspace.yaml but didn’t justify it;
update the PR description and commit message to state that this bump is to
address the GitHub-reported MODERATE DoS vulnerability in qs.stringify (fixed in
6.15.2 for the arrayFormat:'comma' + encodeValuesOnly case where comma arrays
may contain null/undefined), confirm there are no breaking changes per the
6.15.0–6.15.2 changelog, and state whether you intend to allow future 6.x minors
(keep ^6.15.2) or prefer to pin an exact range (e.g., =6.15.2) and change the
pnpm-workspace.yaml entry "qs: ^6.15.2" accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8a1f0455-4260-4e6d-9c46-d6cb6812c676

📥 Commits

Reviewing files that changed from the base of the PR and between c78df3b and d0d25ec.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • pnpm-workspace.yaml

Comment thread pnpm-workspace.yaml
axios: 1.15.2
jotai: 2.12.4
js-cookie: 3.0.5
js-cookie: 3.0.7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check npm registry for js-cookie versions and security info
echo "=== Checking js-cookie versions ==="
npm view js-cookie versions --json | jq -r '.[]' | grep -E '^3\.0\.(5|6|7)$'

echo -e "\n=== Checking js-cookie 3.0.7 details ==="
npm view js-cookie@3.0.7 version time

echo -e "\n=== Checking GitHub security advisories ==="
gh api graphql -f query='
{
  securityVulnerabilities(first: 10, ecosystem: NPM, package: "js-cookie") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Repository: silverlogic/baseapp-frontend

Length of output: 2021


🌐 Web query:

js-cookie 3.0.7 changelog release notes breaking changes

💡 Result:

The js-cookie version 3.0.7 was released on May 16, 2026 [1][2]. There are no breaking changes introduced in this release [1]. The release primarily focuses on security and maintenance updates [1]: - Security Fix: It addresses a vulnerability (CVE-2026-46625) involving per-instance prototype hijacking in the internal assign helper, which could have allowed cookie-attribute injection [1][3]. - Maintenance: It includes documentation updates by adding the Partitioned attribute to the readme [1], ensures consistent behavior for get('name') and get calls [1], and updates the publishing process to use trusted publishing to the npm registry [1]. As this is a patch release, it is intended to be backward-compatible with previous 3.0.x versions [1][4].

Citations:


Clarify why js-cookie is bumped to 3.0.7 (likely security patch)

  • js-cookie 3.0.7 is the first patched version for a HIGH severity prototype-hijack vulnerability affecting <= 3.0.5; upstream release notes indicate no breaking changes for this patch release.
  • PR should still document whether the bump is specifically to address this security fix and/or to support the cross-subdomain cookie domain behavior.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm-workspace.yaml` at line 39, Update the PR description to explicitly
state why js-cookie was bumped to "js-cookie: 3.0.7" — indicate that this is the
patched release addressing the HIGH-severity prototype-hijack vulnerability
affecting versions <=3.0.5, cite the upstream release/changelog or CVE
reference, confirm upstream notes that there are no breaking changes for 3.0.7,
and note whether the bump was also intended to support cross-subdomain cookie
domain behavior; if uncertain, verify the changelog or tests and state that the
bump is solely a security fix.

Comment thread pnpm-workspace.yaml
@Janekk Janekk force-pushed the feature/cross-subdomain-auth-cookies branch 2 times, most recently from f52a78e to d0d25ec Compare June 2, 2026 18:26
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
  * Updated axios HTTP client library to version 1.16.0

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

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.

7 participants