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/> <br/>
<RadzenButton Click=@login Text="login" ButtonStyle="ButtonStyle.Secondary" /> <RadzenButton Click=@login Text="login" ButtonStyle="ButtonStyle.Secondary" />
</form> </form>
<br/>
<br/>
<br/>
@if (msg != null)
{
<span class="msg">@msg</span>
}
</div> </div>
@ -36,7 +43,20 @@
private async Task login() private async Task login()
{ {
if (!is18) if (!is18)
{
msg = "You have to be atleast 18 years old to register.";
return; 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..."); Console.WriteLine("Registering...");
UserData userToCreate = new UserData() UserData userToCreate = new UserData()
{ {

View file

@ -8,4 +8,8 @@
font-style: unset;} font-style: unset;}
.gaping{ .gaping{
alignment: left; alignment: left;
}
.msg{
color: #ff191c;
} }