aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Web/Models/Identity/Validation/GoodPasswordModelValidation.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-01-19 21:46:06 +0200
committertranstrike <transtrike@gmail.com>2021-01-19 21:46:06 +0200
commit8560caa13b7f7d0e80ee712c77efc59a80e8935c (patch)
tree02643afdd46122dfd904fbb8632117a5494081a8 /src/DevHive.Web/Models/Identity/Validation/GoodPasswordModelValidation.cs
parent661c3194b750e42146e9e28a33da08419b2b2cea (diff)
downloadDevHive-8560caa13b7f7d0e80ee712c77efc59a80e8935c.tar
DevHive-8560caa13b7f7d0e80ee712c77efc59a80e8935c.tar.gz
DevHive-8560caa13b7f7d0e80ee712c77efc59a80e8935c.zip
Added attributes to the Web models for validations
Diffstat (limited to 'src/DevHive.Web/Models/Identity/Validation/GoodPasswordModelValidation.cs')
-rw-r--r--src/DevHive.Web/Models/Identity/Validation/GoodPasswordModelValidation.cs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/DevHive.Web/Models/Identity/Validation/GoodPasswordModelValidation.cs b/src/DevHive.Web/Models/Identity/Validation/GoodPasswordModelValidation.cs
deleted file mode 100644
index f920c35..0000000
--- a/src/DevHive.Web/Models/Identity/Validation/GoodPasswordModelValidation.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.ComponentModel.DataAnnotations;
-
-namespace DevHive.Web.Models.Identity.Validation
-{
- public class GoodPassword : ValidationAttribute
- {
- public override bool IsValid(object value)
- {
- var stringValue = (string)value;
-
- for (int i = 0; i < stringValue.Length; i++)
- {
- if (Char.IsDigit(stringValue[i]))
- {
- base.ErrorMessage = "Password must be atleast 5 characters long!";
- return stringValue.Length >= 5;
- }
- }
- base.ErrorMessage = "Password must contain atleast 1 digit!";
- return false;
- }
- }
-}