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:
David Mehren 2021-05-09 22:05:47 +02:00
parent f4587cfa9b
commit 0d9dfc4076
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 8 additions and 13 deletions

View file

@ -184,14 +184,10 @@ export class AuthService {
label: authToken.label,
keyId: authToken.keyId,
createdAt: authToken.createdAt,
validUntil: null,
validUntil: authToken.validUntil,
lastUsed: null,
};
if (authToken.validUntil) {
tokenDto.validUntil = new Date(authToken.validUntil);
}
if (authToken.lastUsed) {
tokenDto.lastUsed = new Date(authToken.lastUsed);
}