Skip to content

Fix/early signout hotfix #1054

Merged
ThinuwanW merged 2 commits intorelease-14from
fix/early-signout-hotfix
Feb 10, 2026
Merged

Fix/early signout hotfix #1054
ThinuwanW merged 2 commits intorelease-14from
fix/early-signout-hotfix

Conversation

@hasalarootcode
Copy link
Contributor

PR checklist

TaskId: (https://github.com/SkappHQ/skapp/issues/[id])

Summary

How to test

Project Checklist

  • Changes build without any errors
  • Have written adequate test cases
  • Done developer testing in
    • Chrome
    • Firefox
    • Safari
  • Code is formatted with npm run format
  • Code is linted with npm run check-lint
  • No unnecessary comments left in code
  • Made corresponding changes to the documentation

Other

  • New atomic components added
  • New molecules added
  • New pages(routes) added
  • New dependencies installed

PR Checklist

  • Pull request is raised from the correct source branch
  • Pull request is raised to the correct destination branch
  • Pull request is raised with correct title
  • Pull request is self reviewed
  • Pull request is self assigned
  • Suitable pull request status labels are added (ready-for-code-review)

Additional Information

Copilot AI review requested due to automatic review settings February 6, 2026 04:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request aims to fix an early signout issue by extending cookie expiration times and refactoring how tenant ID is accessed across the application. The changes consolidate cookie expiry durations and shift from using a reactive tenant ID from user session data to a static tenant ID extracted from the window hostname.

Changes:

  • Extended authentication cookie expiration from 1 day to 31 days to prevent premature session termination
  • Refactored tenant ID access from user session data to a static import from axiosInterceptor
  • Created a new constant file for cookie expiry configuration

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
frontend/src/community/auth/constants/authContants.ts New constant file defining COOKIE_EXPIRY_DAYS (31 days) for consistent cookie expiration
frontend/src/community/auth/utils/authUtils.ts Updated cookie expiry logic to use new COOKIE_EXPIRY_DAYS constant, extending both accessToken and isPasswordChangedForTheFirstTime cookies to 31 days
frontend/src/community/common/hooks/useSessionData.ts Removed local tenantID computation and imported it from axiosInterceptor instead
frontend/src/community/common/components/organisms/Drawer/Drawer.tsx Updated to import and use tenantID directly from axiosInterceptor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1 @@
export const COOKIE_EXPIRY_DAYS = 31; No newline at end of file
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The filename "authContants.ts" has a spelling error. It should be "authConstants.ts" (missing 's' in "Constants"). This will help maintain consistency and avoid confusion.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we address this comment if not a big deal
Also why 31, usually 30 neh (1 month) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can make it 30 days as well. Just added a buffer to ensure we get the most out of the current refresh token.

Copy link
Contributor

Choose a reason for hiding this comment

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

shall we then since the standard for the month is 30 @hasalarootcode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

import { TenantStatusEnums, TierEnum } from "~enterprise/common/enums/Common";

import { config } from "../../../../middleware";
import { COOKIE_EXPIRY_DAYS } from "../constants/authContants";
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The import statement references the misspelled filename "authContants.ts". After renaming the file to "authConstants.ts", this import will need to be updated accordingly.

Suggested change
import { COOKIE_EXPIRY_DAYS } from "../constants/authContants";
import { COOKIE_EXPIRY_DAYS } from "../constants/authConstants";

Copilot uses AI. Check for mistakes.
Comment on lines 94 to 96
return {
isFreeTier,
isProTier,
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The tenantID has been removed from the return value of useSessionData (previously returned at line 117), but it's still being imported and used in frontend/src/community/people/components/organisms/EmploymentFormSection/EmploymentDetailsForm.tsx at line 74. This will cause a runtime error where tenantID will be undefined. Either tenantID needs to be added back to the return value of useSessionData (in the return statement around line 94), or EmploymentDetailsForm.tsx needs to be updated to import tenantID directly from axiosInterceptor.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1 @@
export const COOKIE_EXPIRY_DAYS = 31; No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we address this comment if not a big deal
Also why 31, usually 30 neh (1 month) ?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

@ThinuwanW ThinuwanW merged commit ee4cd8f into release-14 Feb 10, 2026
4 of 5 checks passed
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.

2 participants