mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-18 23:42:28 +00:00
Refactor deserialization and authentication (#550)
* Refactor deserialization and more * Refactor authentication flow * Fix unit tests * Make deserialization better
This commit is contained in:
parent
505b5eb03b
commit
b3a00da554
48 changed files with 575 additions and 589 deletions
|
@ -63,14 +63,18 @@ public class LoginForm : BaseLayout
|
|||
if (user == null)
|
||||
{
|
||||
Logger.Warn($"User {username} failed to login on web due to invalid username", LogArea.Login);
|
||||
this.Error = "The username or password you entered is invalid.";
|
||||
this.Error = ServerConfiguration.Instance.Mail.MailEnabled
|
||||
? "The email or password you entered is invalid."
|
||||
: "The username or password you entered is invalid.";
|
||||
return this.Page();
|
||||
}
|
||||
|
||||
if (!BCrypt.Net.BCrypt.Verify(password, user.Password))
|
||||
{
|
||||
Logger.Warn($"User {user.Username} (id: {user.UserId}) failed to login on web due to invalid password", LogArea.Login);
|
||||
this.Error = "The username or password you entered is invalid.";
|
||||
this.Error = ServerConfiguration.Instance.Mail.MailEnabled
|
||||
? "The email or password you entered is invalid."
|
||||
: "The username or password you entered is invalid.";
|
||||
return this.Page();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue