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;
|
2021-08-13 15:28:03 +02:00
|
|
|
setTokens: (accessToken: string, refreshToken: string, clientIdClientSecret: [string, string]) => Promise<any>;
|
2018-01-25 05:27:04 +01:00
|
|
|
setToken: (token: string) => Promise<any>;
|
|
|
|
getToken: () => Promise<string>;
|
|
|
|
setRefreshToken: (refreshToken: string) => Promise<any>;
|
|
|
|
getRefreshToken: () => Promise<string>;
|
2021-08-13 15:28:03 +02:00
|
|
|
setClientId: (clientId: string) => Promise<any>;
|
|
|
|
getClientId: () => Promise<string>;
|
|
|
|
setClientSecret: (clientSecret: string) => Promise<any>;
|
|
|
|
getClientSecret: () => 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;
|
2021-11-09 17:01:22 +01:00
|
|
|
getIsExternal: () => boolean;
|
2018-01-09 22:19:55 +01:00
|
|
|
}
|