Feat/2286: Dynamically handle get started button in the product site based on session#737
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds environment-aware logic to the profile menu’s sign-out flow to clear the tenant cookie only in enterprise mode and updates the enterprise pages submodule reference.
- Import
appModesanduseGetEnvironmentto detect the current deployment environment. - Wrap tenant‐cookie deletion in an
ENTERPRISEenvironment check. - Bump the enterprise submodule commit in
frontend/pages/enterprise.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/community/common/components/molecules/ProfileMenu/ProfileMenu.tsx | Add environment hook and conditional tenant‐cookie clearing on sign out |
| frontend/pages/enterprise | Update submodule commit reference |
Comments suppressed due to low confidence (2)
frontend/src/community/common/components/molecules/ProfileMenu/ProfileMenu.tsx:17
- [nitpick] Importing an enterprise-specific hook into a community component increases coupling; consider passing the environment flag down as a prop or abstracting this logic higher up to decouple modules.
import { useGetEnvironment } from "~enterprise/common/hooks/useGetEnvironment";
frontend/src/community/common/components/molecules/ProfileMenu/ProfileMenu.tsx:72
- The new conditional logic for
ENTERPRISEmode should have unit tests to verify that the tenant cookie is only cleared in enterprise environments.
if (environment === appModes.ENTERPRISE) {
|
|
||
| const handleSignOut = async () => { | ||
| if (environment === appModes.ENTERPRISE) { | ||
| document.cookie = `tenant=; domain=.${process.env.NEXT_PUBLIC_DOMAIN}; secure; path=/; SameSite=Lax`; |
There was a problem hiding this comment.
To reliably delete the tenant cookie, include an expiration directive (e.g., expires=Thu, 01 Jan 1970 00:00:00 GMT or Max-Age=0) when setting it.
| document.cookie = `tenant=; domain=.${process.env.NEXT_PUBLIC_DOMAIN}; secure; path=/; SameSite=Lax`; | |
| document.cookie = `tenant=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=.${process.env.NEXT_PUBLIC_DOMAIN}; secure; path=/; SameSite=Lax`; |
|



PR checklist
TaskId: (https://github.com/rootcodelabs/skapp-ep/issues/2286)
Summary
How to test
Project Checklist
npm run formatnpm run check-lintOther
PR Checklist
ready-for-code-review)Additional Information