mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-17 18:05:42 +02:00
Do not spam with expected invite errors (#10241)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -1105,13 +1105,11 @@ export async function createWorkspaceRecord (
|
||||
export async function checkInvite (ctx: MeasureContext, invite: WorkspaceInvite, email: string): Promise<WorkspaceUuid> {
|
||||
if (invite.remainingUses === 0) {
|
||||
ctx.error('Invite limit exceeded', { email, ...invite })
|
||||
Analytics.handleError(new Error(`Invite limit exceeded ${email}`))
|
||||
throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {}))
|
||||
}
|
||||
|
||||
if (invite.expiresOn > 0 && invite.expiresOn < Date.now()) {
|
||||
ctx.error('Invite link expired', { email, ...invite })
|
||||
Analytics.handleError(new Error(`Invite link expired ${invite.id} ${email}`))
|
||||
throw new PlatformError(new Status(Severity.ERROR, platform.status.ExpiredLink, {}))
|
||||
}
|
||||
|
||||
@@ -1129,7 +1127,6 @@ export async function checkInvite (ctx: MeasureContext, invite: WorkspaceInvite,
|
||||
|
||||
if (invite.email != null && invite.email.trim().length > 0 && invite.email !== email) {
|
||||
ctx.error("Invite doesn't allow this email address", { email, ...invite })
|
||||
Analytics.handleError(new Error(`Invite link email check failed ${invite.id} ${email} ${invite.email}`))
|
||||
throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {}))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user