2018-01-25 05:27:04 +01:00
|
|
|
export abstract class TokenService {
|
2018-01-09 22:19:55 +01:00
|
|
|
token: string;
|
|
|
|
decodedToken: any;
|
|
|
|
refreshToken: string;
|
2018-01-25 05:27:04 +01:00
|
|
|
setTokens: (accessToken: string, refreshToken: string) => Promise<any>;
|
|
|
|
setToken: (token: string) => Promise<any>;
|
|
|
|
getToken: () => Promise<string>;
|
|
|
|
setRefreshToken: (refreshToken: string) => Promise<any>;
|
|
|
|
getRefreshToken: () => Promise<string>;
|
2020-04-06 18:06:32 +02:00
|
|
|
toggleTokens: () => Promise<any>;
|
2018-01-25 05:27:04 +01:00
|
|
|
setTwoFactorToken: (token: string, email: string) => Promise<any>;
|
|
|
|
getTwoFactorToken: (email: string) => Promise<string>;
|
|
|
|
clearTwoFactorToken: (email: string) => Promise<any>;
|
|
|
|
clearToken: () => Promise<any>;
|
|
|
|
decodeToken: () => any;
|
|
|
|
getTokenExpirationDate: () => Date;
|
|
|
|
tokenSecondsRemaining: (offsetSeconds?: number) => number;
|
|
|
|
tokenNeedsRefresh: (minutes?: number) => boolean;
|
|
|
|
getUserId: () => string;
|
|
|
|
getEmail: () => string;
|
2018-07-02 16:27:27 +02:00
|
|
|
getEmailVerified: () => boolean;
|
2018-01-25 05:27:04 +01:00
|
|
|
getName: () => string;
|
|
|
|
getPremium: () => boolean;
|
|
|
|
getIssuer: () => string;
|
2018-01-09 22:19:55 +01:00
|
|
|
}
|