Methods
changePassword
- changePassword(user: CognitoUser, oldPassword: string, newPassword: string): Promise<"SUCCESS">
-
Parameters
-
user: CognitoUser
-
oldPassword: string
-
newPassword: string
Returns Promise<"SUCCESS">
- A promise resolves if success
completeNewPassword
- completeNewPassword(user: CognitoUser, password: string, requiredAttributes: any): Promise<CognitoUser>
-
Parameters
-
user: CognitoUser
-
password: string
-
requiredAttributes: any
Returns Promise<CognitoUser>
configure
- configure(config: any): any
confirmSignIn
- confirmSignIn(user: CognitoUser, code: string, mfaType?: "SMS_MFA" | "SOFTWARE_TOKEN_MFA" | null): Promise<CognitoUser>
-
Parameters
-
user: CognitoUser
-
code: string
-
Optional mfaType: "SMS_MFA" | "SOFTWARE_TOKEN_MFA" | null
Returns Promise<CognitoUser>
confirmSignUp
-
Parameters
-
username: string
-
code: string
-
Returns Promise<any>
- A promise resolves callback data if success
currentAuthenticatedUser
- currentAuthenticatedUser(): Promise<CognitoUser | any>
-
Returns Promise<CognitoUser | any>
- A promise resolves to curret 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
- currentUserPoolUser(): Promise<CognitoUser>
-
Returns Promise<CognitoUser>
- A promise resolves to curret 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
-
provider: "google" | "facebook" | "amazon" | "developer"
-
-
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): Promise<MFAOption[]>
-
Parameters
Returns Promise<MFAOption[]>
- A promise resolves the current preferred mfa option if success
getPreferredMFA
- getPreferredMFA(user: any): Promise<string>
-
Parameters
Returns Promise<string>
resendSignUp
- resendSignUp(username: string): Promise<string>
-
Parameters
Returns Promise<string>
- A promise resolves data if success
sendCustomChallengeAnswer
- sendCustomChallengeAnswer(user: CognitoUser, challengeResponses: string): Promise<CognitoUser>
-
Parameters
-
user: CognitoUser
-
challengeResponses: string
Returns Promise<CognitoUser>
setPreferredMFA
- setPreferredMFA(user: CognitoUser, mfaMethod: "TOTP" | "SMS" | "NOMFA"): Promise<string>
-
Parameters
-
user: CognitoUser
-
mfaMethod: "TOTP" | "SMS" | "NOMFA"
Returns Promise<string>
- A promise resolve if success
setupTOTP
- setupTOTP(user: CognitoUser): Promise<string>
-
Parameters
Returns Promise<string>
- A promise resolves with the secret code if success
signIn
- signIn(username: string, password?: string): Promise<CognitoUser>
-
Parameters
-
username: string
-
Optional password: string
Returns Promise<CognitoUser>
- 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, attributes: object): Promise<string>
-
Parameters
-
user: CognitoUser
-
attributes: object
Returns Promise<string>
userAttributes
- userAttributes(user: CognitoUser): 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): 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, challengeAnswer: string): Promise<CognitoUserSession>
-
Parameters
-
user: CognitoUser
-
challengeAnswer: string
Returns Promise<CognitoUserSession>
- A promise resolves is success
verifyUserAttribute
- verifyUserAttribute(user: CognitoUser, attr: string): Promise<void>
-
Parameters
-
user: CognitoUser
-
attr: string
Returns Promise<void>
- A promise resolves to callback data if success
verifyUserAttributeSubmit
- verifyUserAttributeSubmit(user: CognitoUser, attr: string, code: string): Promise<string>
-
Parameters
-
user: CognitoUser
-
attr: string
-
code: string
Returns Promise<string>
- A promise resolves to callback data if success
Provide authentication steps