From 7f5a282058fe14301affd4e26ecf7ce5d0ce116c Mon Sep 17 00:00:00 2001 From: limited_dev Date: Mon, 12 Jun 2023 21:22:44 +0200 Subject: [PATCH] fix: fixed login problems, email now cannot be changed if the mail is already in use when changing emails Signed-off-by: limited_dev --- .../Accounts/ClickOn/ClickOnResetPassword.razor | 2 +- ImageBoardServerApp/Pages/Accounts/Login.razor | 2 +- .../Pages/Accounts/Register.razor | 2 +- .../Pages/Accounts/ResetPassword.razor | 2 +- .../Pages/Accounts/UserPage.razor | 16 ++++++++-------- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ImageBoardServerApp/Pages/Accounts/ClickOn/ClickOnResetPassword.razor b/ImageBoardServerApp/Pages/Accounts/ClickOn/ClickOnResetPassword.razor index c9f5592..910b2e7 100644 --- a/ImageBoardServerApp/Pages/Accounts/ClickOn/ClickOnResetPassword.razor +++ b/ImageBoardServerApp/Pages/Accounts/ClickOn/ClickOnResetPassword.razor @@ -13,7 +13,7 @@

- +
@if (msg != null) diff --git a/ImageBoardServerApp/Pages/Accounts/Login.razor b/ImageBoardServerApp/Pages/Accounts/Login.razor index c86bdd6..e94d6fe 100644 --- a/ImageBoardServerApp/Pages/Accounts/Login.razor +++ b/ImageBoardServerApp/Pages/Accounts/Login.razor @@ -18,7 +18,7 @@

- +
diff --git a/ImageBoardServerApp/Pages/Accounts/Register.razor b/ImageBoardServerApp/Pages/Accounts/Register.razor index ab36a4d..3d0351f 100644 --- a/ImageBoardServerApp/Pages/Accounts/Register.razor +++ b/ImageBoardServerApp/Pages/Accounts/Register.razor @@ -22,7 +22,7 @@

- +

diff --git a/ImageBoardServerApp/Pages/Accounts/ResetPassword.razor b/ImageBoardServerApp/Pages/Accounts/ResetPassword.razor index effcda2..627f301 100644 --- a/ImageBoardServerApp/Pages/Accounts/ResetPassword.razor +++ b/ImageBoardServerApp/Pages/Accounts/ResetPassword.razor @@ -10,7 +10,7 @@

- +
@if (msg != null) diff --git a/ImageBoardServerApp/Pages/Accounts/UserPage.razor b/ImageBoardServerApp/Pages/Accounts/UserPage.razor index dbeda3f..2147f78 100644 --- a/ImageBoardServerApp/Pages/Accounts/UserPage.razor +++ b/ImageBoardServerApp/Pages/Accounts/UserPage.razor @@ -10,21 +10,15 @@

YOUR ACCOUNT


- UserId: @userid + Email: @userid
- @if (u != null) - { - Current email: @u.Email -
- } - Email:


- +
@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;