feat: added checks to signup
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
3c3bf898ca
commit
94a705b840
2 changed files with 24 additions and 0 deletions
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -8,4 +8,8 @@
|
|||
font-style: unset;}
|
||||
.gaping{
|
||||
alignment: left;
|
||||
}
|
||||
|
||||
.msg{
|
||||
color: #ff191c;
|
||||
}
|
Loading…
Reference in a new issue