feat: added checks to signup

Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
limited_dev 2023-06-07 14:46:28 +02:00
parent 3c3bf898ca
commit 94a705b840
2 changed files with 24 additions and 0 deletions

View file

@ -21,6 +21,13 @@
<br/>
<RadzenButton Click=@login Text="login" ButtonStyle="ButtonStyle.Secondary" />
</form>
<br/>
<br/>
<br/>
@if (msg != null)
{
<span class="msg">@msg</span>
}
</div>
@ -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()
{

View file

@ -9,3 +9,7 @@
.gaping{
alignment: left;
}
.msg{
color: #ff191c;
}