[backend/api] Improve invalid old password message
This commit is contained in:
parent
897fe6e55a
commit
250f49fee2
1 changed files with 1 additions and 1 deletions
|
@ -140,7 +140,7 @@ public class AuthController(DatabaseContext db, UserService userSvc, UserRendere
|
|||
var settings = await db.UserSettings.FirstOrDefaultAsync(p => p.User == user);
|
||||
if (settings is not { Password: not null }) throw new Exception("settings?.Password was null");
|
||||
if (!AuthHelpers.ComparePassword(request.OldPassword, settings.Password))
|
||||
throw GracefulException.BadRequest("old_password is invalid");
|
||||
throw GracefulException.BadRequest("Old password is incorrect");
|
||||
if (request.NewPassword.Length < 8)
|
||||
throw GracefulException.BadRequest("Password must be at least 8 characters long");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue