From 94a705b84073fce79b240bdac3cdec1ea841e77c Mon Sep 17 00:00:00 2001 From: limited_dev Date: Wed, 7 Jun 2023 14:46:28 +0200 Subject: [PATCH] feat: added checks to signup Signed-off-by: limited_dev --- .../Pages/Accounts/Register.razor | 20 +++++++++++++++++++ .../Pages/Accounts/Register.razor.css | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/ImageBoardServerApp/Pages/Accounts/Register.razor b/ImageBoardServerApp/Pages/Accounts/Register.razor index c955f09..7dd69ea 100644 --- a/ImageBoardServerApp/Pages/Accounts/Register.razor +++ b/ImageBoardServerApp/Pages/Accounts/Register.razor @@ -21,6 +21,13 @@
+
+
+
+ @if (msg != null) + { + @msg + } @@ -36,7 +43,20 @@ private async Task login() { if (!is18) + { + msg = "You have to be atleast 18 years old to register."; return; + } + if (!Email.Contains("@") || !Email.Contains(".")) + { + msg = "This Email address is not valid!"; + return; + } + if (Password.Length < 6) + { + msg = "Your password has to be longer then 6 characters."; + return; + } Console.WriteLine("Registering..."); UserData userToCreate = new UserData() { diff --git a/ImageBoardServerApp/Pages/Accounts/Register.razor.css b/ImageBoardServerApp/Pages/Accounts/Register.razor.css index 1b050a0..8c749bc 100644 --- a/ImageBoardServerApp/Pages/Accounts/Register.razor.css +++ b/ImageBoardServerApp/Pages/Accounts/Register.razor.css @@ -8,4 +8,8 @@ font-style: unset;} .gaping{ alignment: left; +} + +.msg{ + color: #ff191c; } \ No newline at end of file