question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CognitoUser TypeScript definition missing challengeName

See original GitHub issue

Describe the bug The CognitoUser TS definition exported from @aws-amplify/auth is missing challengeName on its interface, so whenever I try to check user.challengeName, I receive an error

Expected behavior challengeName should be included in type definition for CognitoUser

Error

Property 'challengeName' does not exist on type 'CognitoUser'.

Dependencies:

  • @aws-amplify/auth: 1.2.28

Sample code Sandbox: https://codesandbox.io/s/cognitouser-issue-hd7y1 (check src/index.ts file)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
ghostcommented, Nov 9, 2019

@iamkevinwolf I can confirm this is still an ongoing issue as I’ve only just come across it. Its probably been abit too long for this reply to be of any good to you but for the interim as a quick fix i’ve resorted to the following:

export type AuthChallengeName =
  | "NEW_PASSWORD_REQUIRED"
  | "SMS_MFA"
  | "SOFTWARE_TOKEN_MFA"
  | "MFA_SETUP";

export type AuthUser =  CognitoUser & {
  challengeName: AuthChallengeName
}

furthermore, challengeParam is also not yet defined…

7reactions
danielsharveycommented, Feb 4, 2022

Still missing? Re-open?

Read more comments on GitHub >

github_iconTop Results From Across the Web

amazon-cognito-identity-js - npm
The Amazon Cognito Identity SDK for JavaScript requires two configuration values from your AWS Account in order to access your Cognito User ......
Read more >
RespondToAuthChallenge - Amazon Cognito User Pools
ChallengeName. The challenge name. For more information, see InitiateAuth. ADMIN_NO_SRP_AUTH isn't a valid value. Type: String.
Read more >
Passwordless authentication flow in Cognito User Pool
Passwordless authentication flow in Cognito User Pool ... 5 "define-challenge-lambda", ... issueTokens , failAuthentication and challengeName .
Read more >
AuthClass | amplify-js
changePassword(user: CognitoUser | any, oldPassword: string, newPassword: string, clientMetadata?: ClientMetaData): Promise<"SUCCESS">. Defined in ...
Read more >
Magic links with Cognito using the CDK - DEV Community ‍ ‍
Tagged with cdk, lambda, cognito, typescript. ... We need to create a Cognito User Pool and App Client that will help us register...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found