fix(auth): handle missing workspaceId in auth service (#11173)
Add a check to return undefined if workspaceId is not provided. Prevents unnecessary execution and potential errors during workspace lookup.
This commit is contained in:
@ -562,12 +562,14 @@ export class AuthService {
|
||||
);
|
||||
}
|
||||
|
||||
return await this.workspaceRepository.findOne({
|
||||
where: {
|
||||
id: params.workspaceId,
|
||||
},
|
||||
relations: ['approvedAccessDomains'],
|
||||
});
|
||||
return params.workspaceId
|
||||
? await this.workspaceRepository.findOne({
|
||||
where: {
|
||||
id: params.workspaceId,
|
||||
},
|
||||
relations: ['approvedAccessDomains'],
|
||||
})
|
||||
: undefined;
|
||||
}
|
||||
|
||||
formatUserDataPayload(
|
||||
|
||||
Reference in New Issue
Block a user