fix(auth): Invite with public url and social sso. (#10216)

Correct the URL parameter name from "inviteHash" to
"workspaceInviteHash" and enhance domain URL handling for
multi-workspace environments.
This commit is contained in:
Antoine Moreaux
2025-02-14 12:58:01 +01:00
committed by GitHub
parent 171091e1ef
commit a4a085392d
4 changed files with 30 additions and 6 deletions

View File

@ -29,7 +29,7 @@ describe('DomainManagerService', () => {
expect(result).toEqual({
customUrl: 'https://custom-host.com/',
subdomainUrl: 'https://subdomain.example.com/',
subdomainUrl: 'https://example.com/',
});
});
@ -39,6 +39,7 @@ describe('DomainManagerService', () => {
.mockImplementation((key: string) => {
const env = {
FRONTEND_URL: 'https://example.com',
IS_MULTIWORKSPACE_ENABLED: true,
};
return env[key];
@ -104,7 +105,6 @@ describe('DomainManagerService', () => {
.mockImplementation((key: string) => {
const env = {
FRONTEND_URL: 'https://example.com',
IS_MULTIWORKSPACE_ENABLED: true,
DEFAULT_SUBDOMAIN: 'test',
};
@ -125,7 +125,6 @@ describe('DomainManagerService', () => {
.mockImplementation((key: string) => {
const env = {
FRONTEND_URL: 'https://example.com',
IS_MULTIWORKSPACE_ENABLED: true,
DEFAULT_SUBDOMAIN: 'default',
};

View File

@ -217,7 +217,9 @@ export class DomainManagerService {
private getTwentyWorkspaceUrl(subdomain: string) {
const url = this.getFrontUrl();
url.hostname = `${subdomain}.${url.hostname}`;
url.hostname = this.environmentService.get('IS_MULTIWORKSPACE_ENABLED')
? `${subdomain}.${url.hostname}`
: url.hostname;
return url.toString();
}