1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-02 13:23:29 +01:00
bitwarden-browser/common/src/abstractions/token.service.ts

31 lines
1.2 KiB
TypeScript
Raw Normal View History

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;
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>;
setClientId: (clientId: string) => Promise<any>;
getClientId: () => Promise<string>;
setClientSecret: (clientSecret: string) => Promise<any>;
getClientSecret: () => Promise<string>;
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;
getIsExternal: () => boolean;
2018-01-09 22:19:55 +01:00
}