Skip to content

Commit 34ef46e

Browse files
committed
[backend] track last login, and joining time for register and login routes
1 parent b855ad2 commit 34ef46e

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Diff for: server/src/auth/auth.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class AuthService {
2525
const match = await bcrypt.compare(password, user?.hashedPassword);
2626

2727
if (!match) {
28-
throw new UnauthorizedException("Password or email doesn't match");
28+
throw new UnauthorizedException('Password or email does not match');
2929
}
3030

3131
user.lastLogin = new Date();

Diff for: server/src/users/users.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export class UsersService {
6767

6868
async create(createUserDto: CreateUserDto): Promise<User> {
6969
const now = new Date();
70-
7170
const createdUser = new this.model({
7271
...createUserDto,
7372
lastLogin: now,

0 commit comments

Comments
 (0)