mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 11:43:46 +00:00
Split jslib into multiple modules (#363)
* Split jslib into multiple modules
This commit is contained in:
25
common/src/abstractions/token.service.ts
Normal file
25
common/src/abstractions/token.service.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export abstract class TokenService {
|
||||
token: string;
|
||||
decodedToken: any;
|
||||
refreshToken: string;
|
||||
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>;
|
||||
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;
|
||||
getEmailVerified: () => boolean;
|
||||
getName: () => string;
|
||||
getPremium: () => boolean;
|
||||
getIssuer: () => string;
|
||||
}
|
||||
Reference in New Issue
Block a user