mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 18:55:19 -04:00
AuthTokenEntity: Make validUntil not nullable
As all tokens are valid for a maximum of 2 years, the validUntil attribute is always populated. This updates the database schema and the DTO to reflect that. Fixes #1256 Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
6ddaa59e8c
commit
375cb4eae9
4 changed files with 8 additions and 13 deletions
|
@ -309,11 +309,14 @@ describe('AuthService', () => {
|
|||
authToken.keyId = 'testKeyId';
|
||||
authToken.label = 'testLabel';
|
||||
authToken.createdAt = new Date();
|
||||
authToken.validUntil = new Date();
|
||||
const tokenDto = service.toAuthTokenDto(authToken);
|
||||
expect(tokenDto.keyId).toEqual(authToken.keyId);
|
||||
expect(tokenDto.lastUsed).toBeNull();
|
||||
expect(tokenDto.label).toEqual(authToken.label);
|
||||
expect(tokenDto.validUntil).toBeNull();
|
||||
expect(tokenDto.validUntil.getTime()).toEqual(
|
||||
authToken.createdAt.getTime(),
|
||||
);
|
||||
expect(tokenDto.createdAt.getTime()).toEqual(
|
||||
authToken.createdAt.getTime(),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue