Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and update MFA typescript interface for CognitoUser #279

Merged
merged 3 commits into from Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,4 +6,5 @@ node_modules/**
packages/*/node_modules/**
.DS_Store
.vscode
.idea
*.log
13 changes: 11 additions & 2 deletions packages/amazon-cognito-identity-js/index.d.ts
Expand Up @@ -48,7 +48,10 @@ declare module "amazon-cognito-identity-js" {
onFailure: (err: any) => void,
newPasswordRequired?: (userAttributes: any, requiredAttributes: any) => void,
mfaRequired?: (challengeName: any, challengeParameters: any) => void,
customChallenge?: (challengeParameters: any) => void
totpRequired?: (challengeName: any, challengeParameters: any) => void,
customChallenge?: (challengeParameters: any) => void,
mfaSetup?: (challengeName: any, challengeParameters: any) => void,
selectMFAType?: (challengeName: any, challengeParameters: any) => void
}): void;
public confirmRegistration(code: string, forceAliasCreation: boolean, callback: NodeCallback<any, any>): void;
public sendCustomChallengeAnswer(answerChallenge: any, callback:NodeCallback<any, any>):void;
Expand All @@ -59,7 +62,7 @@ declare module "amazon-cognito-identity-js" {
public setDeviceStatusRemembered(callbacks: { onSuccess: (success: string) => void, onFailure: (err: any) => void }): void;
public setDeviceStatusNotRemembered(callbacks: { onSuccess: (success: string) => void, onFailure: (err: any) => void }): void;
public getDevice(callbacks: {onSuccess: (success: string) => void, onFailure: (err: Error) => void}): any;
public sendMFACode(confirmationCode: string, callbacks: { onSuccess: (session: CognitoUserSession) => void, onFailure: (err: any) => void }): void;
public sendMFACode(confirmationCode: string, callbacks: { onSuccess: (session: CognitoUserSession) => void, onFailure: (err: any) => void }, mfaType: string): void;
public completeNewPasswordChallenge(newPassword: string,
requiredAttributeData: any,
callbacks: {
Expand All @@ -79,6 +82,12 @@ declare module "amazon-cognito-identity-js" {
public enableMFA(callback: NodeCallback<Error, string>): void;
public disableMFA(callback: NodeCallback<Error, string>): void;
public getMFAOptions(callback: NodeCallback<Error, MFAOption[]>): void;
public associateSoftwareToken(
callbacks: {
associateSecretCode: (secretCode: string) => void,
onFailure: (err: any) => void
});
public verifySoftwareToken(totpCode, friendlyDeviceName, callbacks: {onSuccess: (session: CognitoUserSession) => void, onFailure: (err: Error) => void}): any;
}

export interface MFAOption {
Expand Down