Methods
changePassword
- changePassword(user: CognitoUser | any, oldPassword: string, newPassword: string): Promise<"SUCCESS">
-
Parameters
-
user: CognitoUser | any
-
oldPassword: string
-
newPassword: string
Returns Promise<"SUCCESS">
- A promise resolves if success
completeNewPassword
- completeNewPassword(user: CognitoUser | any, password: string, requiredAttributes: any): Promise<CognitoUser | any>
-
Parameters
-
user: CognitoUser | any
-
password: string
-
requiredAttributes: any
Returns Promise<CognitoUser | any>
configure
- configure(config: any): any
confirmSignIn
- confirmSignIn(user: CognitoUser | any, code: string, mfaType?: "SMS_MFA" | "SOFTWARE_TOKEN_MFA" | null): Promise<CognitoUser | any>
-
Parameters
-
user: CognitoUser | any
-
code: string
-
Optional mfaType: "SMS_MFA" | "SOFTWARE_TOKEN_MFA" | null
Returns Promise<CognitoUser | any>
confirmSignUp
-
Parameters
-
username: string
-
code: string
-
Returns Promise<any>
- A promise resolves callback data if success
currentAuthenticatedUser
- currentAuthenticatedUser(params?: CurrentUserOpts): Promise<CognitoUser | any>
-
Parameters
Returns Promise<CognitoUser | any>
- A promise resolves to current authenticated CognitoUser if success
currentSession
- currentSession(): Promise<CognitoUserSession>
-
Returns Promise<CognitoUserSession>
- A promise resolves to session object if success
currentUserCredentials
-
- A promise resolves to be current user's credentials
currentUserInfo
- currentUserInfo(): Promise<any>
-
Returns Promise<any>
- current User's information
currentUserPoolUser
-
Parameters
Returns Promise<CognitoUser | any>
- A promise resolves to current authenticated CognitoUser if success
disableSMS
- disableSMS(user: CognitoUser): Promise<string>
-
Parameters
Returns Promise<string>
- A promise resolves is success
enableSMS
- enableSMS(user: CognitoUser): Promise<string>
-
Parameters
Returns Promise<string>
- A promise resolves is success
federatedSignIn
-
Parameters
-
Parameters
-
Parameters
forgotPassword
- forgotPassword(username: string): Promise<any>
-
Parameters
Returns Promise<any>
- A promise resolves if success
forgotPasswordSubmit
- forgotPasswordSubmit(username: string, code: string, password: string): Promise<void>
-
Parameters
-
username: string
-
code: string
-
password: string
Returns Promise<void>
- A promise that resolves if success
getMFAOptions
- getMFAOptions(user: CognitoUser | any): Promise<MFAOption[]>
-
Parameters
Returns Promise<MFAOption[]>
- A promise resolves the current preferred mfa option if success
getPreferredMFA
-
Parameters
Returns Promise<string>
resendSignUp
- resendSignUp(username: string): Promise<string>
-
Parameters
Returns Promise<string>
- A promise resolves data if success
sendCustomChallengeAnswer
- sendCustomChallengeAnswer(user: CognitoUser | any, challengeResponses: string): Promise<CognitoUser | any>
-
Parameters
-
user: CognitoUser | any
-
challengeResponses: string
Returns Promise<CognitoUser | any>
setPreferredMFA
- setPreferredMFA(user: CognitoUser | any, mfaMethod: "TOTP" | "SMS" | "NOMFA"): Promise<string>
-
Parameters
-
user: CognitoUser | any
-
mfaMethod: "TOTP" | "SMS" | "NOMFA"
Returns Promise<string>
- A promise resolve if success
setupTOTP
- setupTOTP(user: CognitoUser | any): Promise<string>
-
Parameters
Returns Promise<string>
- A promise resolves with the secret code if success
signIn
- signIn(usernameOrSignInOpts: string | SignInOpts, pw?: string): Promise<CognitoUser | any>
-
Parameters
-
usernameOrSignInOpts: string | SignInOpts
-
Optional pw: string
Returns Promise<CognitoUser | any>
- A promise resolves the CognitoUser
signOut
-
Parameters
Returns Promise<any>
- A promise resolved if success
signUp
- signUp(params: string | SignUpParams, ...restOfAttrs: string[]): Promise<ISignUpResult>
-
Parameters
-
-
Rest ...restOfAttrs: string[]
Returns Promise<ISignUpResult>
- A promise resolves callback data if success
updateUserAttributes
- updateUserAttributes(user: CognitoUser | any, attributes: object): Promise<string>
-
Parameters
-
user: CognitoUser | any
-
attributes: object
Returns Promise<string>
userAttributes
- userAttributes(user: CognitoUser | any): Promise<CognitoUserAttribute[]>
-
Parameters
Returns Promise<CognitoUserAttribute[]>
- A promise resolves to user attributes if success
userSession
- userSession(user: any): Promise<CognitoUserSession>
-
Parameters
Returns Promise<CognitoUserSession>
- A promise resolves to the session
verifiedContact
- verifiedContact(user: CognitoUser | any): Promise<object>
-
Parameters
Returns Promise<object>
verifyCurrentUserAttribute
- verifyCurrentUserAttribute(attr: string): Promise<void>
-
Parameters
Returns Promise<void>
verifyCurrentUserAttributeSubmit
- verifyCurrentUserAttributeSubmit(attr: string, code: string): Promise<string>
-
Parameters
-
attr: string
-
code: string
Returns Promise<string>
- A promise resolves to callback data if success
verifyTotpToken
- verifyTotpToken(user: CognitoUser | any, challengeAnswer: string): Promise<CognitoUserSession>
-
Parameters
-
user: CognitoUser | any
-
challengeAnswer: string
Returns Promise<CognitoUserSession>
- A promise resolves is success
verifyUserAttribute
- verifyUserAttribute(user: CognitoUser | any, attr: string): Promise<void>
-
Parameters
-
user: CognitoUser | any
-
attr: string
Returns Promise<void>
- A promise resolves to callback data if success
verifyUserAttributeSubmit
- verifyUserAttributeSubmit(user: CognitoUser | any, attr: string, code: string): Promise<string>
-
Parameters
-
user: CognitoUser | any
-
attr: string
-
code: string
Returns Promise<string>
- A promise resolves to callback data if success
Provide authentication steps