Fixed invalid credential handling.
This commit is contained in:
@@ -47,11 +47,9 @@ export async function login(credentials, userIp) {
|
||||
const { user, stashes } = await fetchUser(credentials.username.trim(), {
|
||||
email: true,
|
||||
raw: true,
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
}).catch(() => {
|
||||
throw new HttpError('Username or password incorrect', 401);
|
||||
}
|
||||
});
|
||||
|
||||
await verifyPassword(credentials.password, user.password);
|
||||
|
||||
@@ -59,8 +57,6 @@ export async function login(credentials, userIp) {
|
||||
.update('last_login', 'NOW()')
|
||||
.where('id', user.id);
|
||||
|
||||
console.log('login user', user);
|
||||
|
||||
logger.verbose(`Login from '${user.username}' (${user.id}, ${userIp})`);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user