fix: fixed login problems, email now cannot be changed if the mail is already in use when changing emails
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
ce201207d4
commit
7f5a282058
5 changed files with 12 additions and 12 deletions
|
@ -13,7 +13,7 @@
|
|||
</RadzenFormField>
|
||||
<br/>
|
||||
<br/>
|
||||
<RadzenButton Click=@reset Text="reset" ButtonStyle="ButtonStyle.Secondary" ButtonType="ButtonType.Submit"/>
|
||||
<RadzenButton Click=@reset Text="reset" ButtonStyle="ButtonStyle.Secondary"/>
|
||||
<br/>
|
||||
</form>
|
||||
@if (msg != null)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</RadzenFormField>
|
||||
<br/>
|
||||
<br/>
|
||||
<RadzenButton Click=@login Text="login" ButtonStyle="ButtonStyle.Secondary" ButtonType="ButtonType.Submit"/>
|
||||
<RadzenButton Click=@login Text="login" ButtonStyle="ButtonStyle.Secondary"/>
|
||||
<br/>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<RadzenLabel Text="I am atleast 18 Years old." Component="is_18"/>
|
||||
<br/>
|
||||
<br/>
|
||||
<RadzenButton Click=@login Text="register" ButtonStyle="ButtonStyle.Secondary" ButtonType="ButtonType.Submit"/>
|
||||
<RadzenButton Click=@login Text="register" ButtonStyle="ButtonStyle.Secondary"/>
|
||||
</form>
|
||||
<br/>
|
||||
<br/>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</RadzenFormField>
|
||||
<br/>
|
||||
<br/>
|
||||
<RadzenButton Click=@resetPassword Text="Send reset email" ButtonStyle="ButtonStyle.Secondary" ButtonType="ButtonType.Submit"/>
|
||||
<RadzenButton Click=@resetPassword Text="Send reset email" ButtonStyle="ButtonStyle.Secondary"/>
|
||||
<br/>
|
||||
</form>
|
||||
@if (msg != null)
|
||||
|
|
|
@ -10,21 +10,15 @@
|
|||
<Authorized>
|
||||
<h3>YOUR ACCOUNT</h3>
|
||||
<br/>
|
||||
<span>UserId: @userid</span>
|
||||
<span>Email: @userid</span>
|
||||
<br/>
|
||||
@if (u != null)
|
||||
{
|
||||
<span>Current email: @u.Email</span>
|
||||
<br/>
|
||||
}
|
||||
<span>Email: </span>
|
||||
<form>
|
||||
<RadzenFormField Text="Enter new email address" Variant="Variant.Outlined">
|
||||
<RadzenTextBox @bind-Value="@newMail"/>
|
||||
</RadzenFormField>
|
||||
<br/>
|
||||
<br/>
|
||||
<RadzenButton Click=@changeEmail Text="Set Email" ButtonStyle="ButtonStyle.Secondary" ButtonType="ButtonType.Submit"/>
|
||||
<RadzenButton Click=@changeEmail Text="Set Email" ButtonStyle="ButtonStyle.Secondary"/>
|
||||
<br/>
|
||||
</form>
|
||||
@if (msg != null)
|
||||
|
@ -82,6 +76,12 @@
|
|||
msg = "The new email is not valid.";
|
||||
return;
|
||||
}
|
||||
UserData u2 = await UsersRepository.getUserByEmailRawAsync(newMail);
|
||||
if (u2 != null)
|
||||
{
|
||||
msg = "This email is already in use.";
|
||||
return;
|
||||
}
|
||||
foundusr.Email = newMail;
|
||||
foundusr.lastActionTimeStamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
foundusr.ConfirmedEmail = false;
|
||||
|
|
Loading…
Reference in a new issue