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

26 lines
1000 B
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;
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>;
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
}