From 570d2c65acd4c7faf025fe019f85c3074cdbd8b7 Mon Sep 17 00:00:00 2001 From: Abhishek Mishra Date: Thu, 20 Jul 2023 11:49:41 +0530 Subject: [PATCH] SendOTP: logging user's phone number event as message --- src/api/api.controller.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/api/api.controller.ts b/src/api/api.controller.ts index 0878d71..add53ff 100644 --- a/src/api/api.controller.ts +++ b/src/api/api.controller.ts @@ -23,6 +23,7 @@ import { RefreshRequest } from '@fusionauth/typescript-client/build/src/FusionAu import { ChangePasswordDTO } from '../user/dto/changePassword.dto'; import { LoginDto } from '../user/dto/login.dto'; import { SentryInterceptor } from '../interceptors/sentry.interceptor'; +import * as Sentry from '@sentry/node'; // eslint-disable-next-line @typescript-eslint/no-var-requires const CryptoJS = require('crypto-js'); @@ -62,6 +63,12 @@ export class ApiController { null, ); if (!total || total == 0) { + Sentry.captureMessage('Phone number not registered', { + user: { + phone: phone, + applicationId: applicationId + } + }); throw new UnprocessableEntityException(errorMessage); } }