fix(auth, workspace-invitation): enforce required subdomains (#9464)
Updated the handling of `targetWorkspaceSubdomain` and `subdomain` to enforce them as required fields. This prevents potential issues caused by missing values during sign-in/up and workspace invitation processes.
This commit is contained in:
@ -498,6 +498,7 @@ describe('SignInUpService', () => {
|
|||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
fromSSO: false,
|
fromSSO: false,
|
||||||
|
targetWorkspaceSubdomain: 'testSubDomain',
|
||||||
workspaceInviteHash,
|
workspaceInviteHash,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -122,19 +122,21 @@ export class SignInUpService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const signInUpWithInvitationResult = await this.signInUpWithInvitation({
|
const signInUpWithInvitationResult = targetWorkspaceSubdomain
|
||||||
email,
|
? await this.signInUpWithInvitation({
|
||||||
workspacePersonalInviteToken,
|
email,
|
||||||
workspaceInviteHash,
|
workspacePersonalInviteToken,
|
||||||
targetWorkspaceSubdomain,
|
workspaceInviteHash,
|
||||||
fromSSO,
|
targetWorkspaceSubdomain,
|
||||||
firstName,
|
fromSSO,
|
||||||
lastName,
|
firstName,
|
||||||
picture,
|
lastName,
|
||||||
authProvider,
|
picture,
|
||||||
passwordHash,
|
authProvider,
|
||||||
existingUser,
|
passwordHash,
|
||||||
});
|
existingUser,
|
||||||
|
})
|
||||||
|
: undefined;
|
||||||
|
|
||||||
if (isDefined(signInUpWithInvitationResult)) {
|
if (isDefined(signInUpWithInvitationResult)) {
|
||||||
return signInUpWithInvitationResult;
|
return signInUpWithInvitationResult;
|
||||||
@ -187,7 +189,7 @@ export class SignInUpService {
|
|||||||
passwordHash?: string;
|
passwordHash?: string;
|
||||||
existingUser: User | null;
|
existingUser: User | null;
|
||||||
fromSSO: boolean;
|
fromSSO: boolean;
|
||||||
targetWorkspaceSubdomain?: string;
|
targetWorkspaceSubdomain: string;
|
||||||
}) {
|
}) {
|
||||||
const maybeInvitation =
|
const maybeInvitation =
|
||||||
fromSSO && !workspacePersonalInviteToken && !workspaceInviteHash
|
fromSSO && !workspacePersonalInviteToken && !workspaceInviteHash
|
||||||
|
|||||||
@ -139,7 +139,7 @@ export class WorkspaceInvitationService {
|
|||||||
subdomain,
|
subdomain,
|
||||||
email,
|
email,
|
||||||
}: {
|
}: {
|
||||||
subdomain?: string;
|
subdomain: string;
|
||||||
email: string;
|
email: string;
|
||||||
}) {
|
}) {
|
||||||
const workspace =
|
const workspace =
|
||||||
|
|||||||
Reference in New Issue
Block a user