UNPKG

odp-sdk

Version:

Ocean Data Platform JavaScript SDK

22 lines (21 loc) 712 B
import { AuthenticationResult, BrowserAuthOptions } from "@azure/msal-browser"; interface BaseResponseT { ok: boolean; message: string; } interface UnauthenticatedResponseT extends BaseResponseT { authenticated: false; } interface AuthenticatedResponseT extends BaseResponseT { authenticated: true; token: AuthenticationResult; } export declare type AuthResponseT = AuthenticatedResponseT | UnauthenticatedResponseT; export declare class Auth { private _msalInstance; constructor(authConfig: BrowserAuthOptions); logout: () => Promise<void>; getToken: (scope: string[]) => Promise<string>; handleRedirectAuth: () => Promise<AuthenticationResult | undefined>; } export {};