From 73a2ea2f5f61bd81c4fa11fee3f1fb060b53c5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= Date: Fri, 17 Feb 2023 09:39:56 +0300 Subject: [PATCH] refactoring --- .../Volo/CmsKit/Localization/Resources/en.json | 3 ++- .../Security/Captcha/CaptchaException.cs | 15 --------------- .../Captcha/SimpleMathsCaptchaGenerator.cs | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/CaptchaException.cs diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json index 126e084d26..9bb8dd275c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json @@ -215,6 +215,7 @@ "DeleteBlogPostMessage": "The blog will be deleted. Are you sure?", "CaptchaCode": "Captcha code", "CommentTextRequired": "Comment is required", - "CaptchaCodeErrorMessage" : "The answer you entered for the CAPTCHA was not correct. Please try again" + "CaptchaCodeErrorMessage" : "The answer you entered for the CAPTCHA was not correct. Please try again", + "CaptchaCodeMissingMessage": "The captcha code is missing!" } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/CaptchaException.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/CaptchaException.cs deleted file mode 100644 index 7914e85b02..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/CaptchaException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Runtime.Serialization; -using Volo.Abp; - -namespace Volo.CmsKit.Public.Web.Security.Captcha; - -public class CaptchaException : UserFriendlyException -{ - public CaptchaException(string message) : base(message) - { - } - - public CaptchaException(SerializationInfo serializationInfo, StreamingContext context) : base(serializationInfo, context) - { - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/SimpleMathsCaptchaGenerator.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/SimpleMathsCaptchaGenerator.cs index e30a9d2e5a..220e24f892 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/SimpleMathsCaptchaGenerator.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/SimpleMathsCaptchaGenerator.cs @@ -95,7 +95,7 @@ public class SimpleMathsCaptchaGenerator : ISingletonDependency } else { - throw new CaptchaException("The captcha code is missing!"); + throw new UserFriendlyException(_localizer["CaptchaCodeMissingMessage"]); } }