class-validator on Auth model

ref #12
This commit is contained in:
Philipp Dormann 2020-12-04 22:34:03 +01:00
parent c5c3058f3d
commit c4b7ece974

View File

@ -1,3 +1,5 @@
import { IsInt, IsString } from 'class-validator';
/** /**
* Defines a auth object * Defines a auth object
*/ */
@ -5,17 +7,21 @@ export class Auth {
/** /**
* access_token - JWT shortterm access token * access_token - JWT shortterm access token
*/ */
@IsString()
access_token: string; access_token: string;
/** /**
* refresh_token - longterm refresh token (used for requesting new access tokens) * refresh_token - longterm refresh token (used for requesting new access tokens)
*/ */
@IsString()
refresh_token: string; refresh_token: string;
/** /**
* access_token_expires_at - unix timestamp of access token expiry * access_token_expires_at - unix timestamp of access token expiry
*/ */
@IsInt()
access_token_expires_at: number; access_token_expires_at: number;
/** /**
* refresh_token_expires_at - unix timestamp of access token expiry * refresh_token_expires_at - unix timestamp of access token expiry
*/ */
@IsInt()
refresh_token_expires_at: number; refresh_token_expires_at: number;
} }