fix account save
This commit is contained in:
@@ -64,8 +64,10 @@ export async function login(email: string, password: string): Promise<User> {
|
||||
SELECT * FROM users
|
||||
WHERE email = ${email};
|
||||
`;
|
||||
console.log('1.25: ' + Date.now());
|
||||
if (user) {
|
||||
if (await bcrypt.compare(password, user.passwordHash!)) {
|
||||
console.log('1.5: ' + Date.now());
|
||||
delete user.passwordHash;
|
||||
|
||||
await sql`
|
||||
@@ -73,6 +75,7 @@ export async function login(email: string, password: string): Promise<User> {
|
||||
SET last_sign_in = NOW()
|
||||
WHERE id = ${user.id};
|
||||
`;
|
||||
console.log('1.75: ' + Date.now());
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user