Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions server/account/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {}))
}

Expand All @@ -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, {}))
}

Expand Down
Loading