Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions backend/src/services/integrationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1443,15 +1443,16 @@ export default class IntegrationService {
const errorType = String(error.response.data.type)
const isTwoFactorRequired =
errorType.includes('two_factor_required') || errorType.includes('2nd_factor_required')

if (isTwoFactorRequired) {
throw new Error400(this.options.language, 'Two-factor authentication code is required')
throw new Error400(this.options.language, 'errors.groupsio.isTwoFactorRequired')
}
const invalidCredentials =
errorType.includes('invalid password') || errorType.includes('invalid email')
if (invalidCredentials) throw new Error400(this.options.language, 'Invalid email or password')
if (invalidCredentials)
throw new Error400(this.options.language, 'errors.groupsio.invalidCredentials')
const invalid2FA = errorType.includes('2nd_factor_wrong')
if (invalid2FA)
throw new Error400(this.options.language, 'Invalid Two-factor authentication code')
if (invalid2FA) throw new Error400(this.options.language, 'errors.groupsio.invalid2FA')
throw error
}
}
Expand Down
5 changes: 5 additions & 0 deletions services/libs/common/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ const en = {
invalidCredentials:
'The given credentials were found to be invalid. Please check the credentials and try again',
},
groupsio: {
isTwoFactorRequired: 'Two-factor authentication code is required',
invalidCredentials: 'Invalid email or password',
invalid2FA: 'Invalid Two-factor authentication code',
},
alreadyExists: '{0}',
},

Expand Down
Loading