Skip to content

fix(workspace): simplify hostname matching logic in WorkspaceProvider… #12365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 12, 2025

Conversation

AMoreaux
Copy link
Contributor

…Effect

Replaced getHostnamesFromWorkspaceUrls with isWorkspaceHostnameMatchCurrentLocationHostname for streamlined hostname comparison, reducing redundancy and improving logic clarity.

Fix #12295

…Effect

Replaced `getHostnamesFromWorkspaceUrls` with `isWorkspaceHostnameMatchCurrentLocationHostname` for streamlined hostname comparison, reducing redundancy and improving logic clarity.
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR streamlines workspace URL redirection by simplifying hostname matching logic in the WorkspaceProviderEffect component, ensuring proper redirection to custom domains before sign-in.

  • Introduced isWorkspaceHostnameMatchCurrentLocationHostname in packages/twenty-front/src/modules/workspace/components/WorkspaceProviderEffect.tsx for more efficient URL comparison
  • Remove debug console.log statement in WorkspaceProviderEffect.tsx before merging
  • Consider adding error handling for URL parsing in case of invalid workspace URLs

1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented May 28, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:9298

This environment will automatically shut down when the PR is closed or after 5 hours.

@FelixMalfait FelixMalfait self-assigned this Jun 2, 2025
@FelixMalfait FelixMalfait merged commit a614e00 into main Jun 12, 2025
52 checks passed
@FelixMalfait FelixMalfait deleted the fix/12295 branch June 12, 2025 11:51
@FelixMalfait
Copy link
Member

Let's make sure to test this well before deploy!

naineel1209 pushed a commit to naineel1209/twenty that referenced this pull request Jun 12, 2025
twentyhq#12365)

…Effect

Replaced `getHostnamesFromWorkspaceUrls` with
`isWorkspaceHostnameMatchCurrentLocationHostname` for streamlined
hostname comparison, reducing redundancy and improving logic clarity.

Fix twentyhq#12295
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.

Subdomain should redirect to my domain when I have one
2 participants