2018-08-10 16:09:23 +03:00
|
|
|
export interface BaseClaims {
|
2018-07-01 02:00:17 -06:00
|
|
|
iss: string;
|
2018-08-10 16:09:23 +03:00
|
|
|
exp?: number;
|
|
|
|
}
|
|
|
|
|
2018-08-11 20:35:34 +03:00
|
|
|
export interface AccessToken extends BaseClaims {
|
|
|
|
type: "access";
|
|
|
|
aud: number;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RefreshToken extends BaseClaims {
|
|
|
|
type: "refresh";
|
2018-07-20 00:03:11 -06:00
|
|
|
aud: number;
|
2018-07-01 02:00:17 -06:00
|
|
|
name: string;
|
|
|
|
}
|
2018-08-10 16:09:23 +03:00
|
|
|
|
|
|
|
export interface DeviceRegistrationToken extends BaseClaims {
|
|
|
|
type: "device_reg";
|
|
|
|
}
|
|
|
|
|
2018-08-28 03:22:16 -06:00
|
|
|
export interface DeviceToken extends BaseClaims {
|
|
|
|
type: "device";
|
|
|
|
aud: string;
|
2018-08-28 05:34:23 -06:00
|
|
|
id: number;
|
2018-08-28 03:22:16 -06:00
|
|
|
}
|
|
|
|
|
2018-08-28 05:34:23 -06:00
|
|
|
export interface SuperuserToken extends BaseClaims {
|
|
|
|
type: "superuser";
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TokenClaims = AccessToken | RefreshToken | DeviceRegistrationToken | DeviceToken | SuperuserToken;
|