Implement HostInfo as a class

Replace POJO definition of HostInfo with a class that properly manages
its own serialisation to JSON.
This commit is contained in:
Hornwitser committed 2023-12-09 17:23:24 +01:00
1 parent 20330bc2c3
commit c248363895
6 files changed
+137 -60

No files matched your search

+1 -1
View File
@@ -152,7 +152,7 @@ function validateHostToken(req: Request, res: Response, next: any) {
if (!host) {
throw new Error("invalid host");
}
if (!tokenPayload.iat || tokenPayload.iat < (host.token_valid_after??0)) {
if (!tokenPayload.iat || tokenPayload.iat < (host.tokenValidAfter ?? 0)) {
throw new Error("invalid token");
}
} catch (err) {