UNPKG

@mytmpvpn/mytmpvpn-client

Version:

MyTmpVpn Client Library

28 lines (27 loc) 1.04 kB
import * as auth from 'amazon-cognito-identity-js'; import * as clientLib from './client'; import { AppConfig } from './appconfig'; import { UserProfile } from './userprofiles'; 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; } export declare function createPassword(): string; export declare function createTestUserProfile(): UserProfile;