diff --git a/src/auth/auth-token.dto.ts b/src/auth/auth-token.dto.ts index 46af7d6be..bd3ef8970 100644 --- a/src/auth/auth-token.dto.ts +++ b/src/auth/auth-token.dto.ts @@ -15,8 +15,8 @@ export class AuthTokenDto { createdAt: Date; @IsDate() @IsOptional() - validUntil: Date; + validUntil: Date | null; @IsDate() @IsOptional() - lastUsed: Date; + lastUsed: Date | null; } diff --git a/src/auth/auth.service.spec.ts b/src/auth/auth.service.spec.ts index 4240afb4e..b79f7f0bf 100644 --- a/src/auth/auth.service.spec.ts +++ b/src/auth/auth.service.spec.ts @@ -251,7 +251,7 @@ describe('AuthService', () => { }); jest.spyOn(authTokenRepo, 'save').mockImplementationOnce( async (authTokenSaved: AuthToken, _): Promise => { - expect(authTokenSaved.lastUsed).toBeUndefined(); + expect(authTokenSaved.lastUsed).toBeNull(); return authTokenSaved; }, ); @@ -275,7 +275,7 @@ describe('AuthService', () => { }); jest.spyOn(authTokenRepo, 'save').mockImplementationOnce( async (authTokenSaved: AuthToken, _): Promise => { - expect(authTokenSaved.lastUsed).toBeUndefined(); + expect(authTokenSaved.lastUsed).toBeNull(); return authTokenSaved; }, ); diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index d81a8d5c5..76758e680 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -181,8 +181,6 @@ export class AuthService { toAuthTokenDto(authToken: AuthToken): AuthTokenDto { const tokenDto: AuthTokenDto = { - lastUsed: null, - validUntil: null, label: authToken.label, keyId: authToken.keyId, createdAt: authToken.createdAt,