UNPKG

@mytmpvpn/mytmpvpn-client

Version:

MyTmpVpn Client Library

26 lines (25 loc) 930 B
import * as auth from 'amazon-cognito-identity-js'; import * as clientLib from './client'; import { AppConfig } from './appconfig'; import { UserProfile } from './userconfig'; export interface Auth { authenticate(): Promise<clientLib.MyTmpVpnClient>; register(): Promise<auth.CognitoUser>; confirmRegistration(code: string): Promise<string>; getUser(): auth.CognitoUser | null; getSession(): auth.CognitoUserSession | null; } export declare class AuthImpl implements Auth { private userPool; private userProfile; private cognitoUser; private session; private client; constructor(appConfig: AppConfig, userProfile: UserProfile); private login; authenticate(): Promise<clientLib.MyTmpVpnClient>; register(): Promise<auth.CognitoUser>; confirmRegistration(code: string): Promise<string>; getUser(): auth.CognitoUser; getSession(): auth.CognitoUserSession | null; }