mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-02 13:23:29 +01:00
32 lines
1.3 KiB
TypeScript
32 lines
1.3 KiB
TypeScript
import { IdentityTokenResponse } from "../models/response/identity-token.response";
|
|
|
|
export abstract class TokenService {
|
|
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>;
|
|
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>;
|
|
}
|