1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-03 13:33:32 +01:00
bitwarden-browser/libs/common/src/abstractions/token.service.ts

32 lines
1.3 KiB
TypeScript
Raw Normal View History

import { IdentityTokenResponse } from "../models/response/identityTokenResponse";
2018-01-25 05:27:04 +01:00
export abstract class TokenService {
2021-12-16 13:36:21 +01:00
setTokens: (
accessToken: string,
refreshToken: string,
clientIdClientSecret: [string, string]
) => Promise<any>;
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>;
setTwoFactorToken: (tokenResponse: IdentityTokenResponse) => Promise<any>;
getTwoFactorToken: () => Promise<string>;
clearTwoFactorToken: () => Promise<any>;
2021-12-16 13:36:21 +01:00
clearToken: (userId?: string) => Promise<any>;
decodeToken: (token?: string) => any;
getTokenExpirationDate: () => Promise<Date>;
tokenSecondsRemaining: (offsetSeconds?: number) => Promise<number>;
tokenNeedsRefresh: (minutes?: number) => Promise<boolean>;
getUserId: () => Promise<string>;
getEmail: () => Promise<string>;
getEmailVerified: () => Promise<boolean>;
getName: () => Promise<string>;
getIssuer: () => Promise<string>;
getIsExternal: () => Promise<boolean>;
2018-01-09 22:19:55 +01:00
}