title: Cognito Auth.sendCustomChallengeAnswer gives "AuthClass - Failed to get the signed in user No current user"
body: <p>I am trying to make API <strong>(Lambda and API gateway)</strong> for sign in and verify auth using OTP for <strong>password-less authentication</strong>. The target is to make front end using angular and mobile application using Flutter but there is no support of AWS Amplify for flutter. So going through to create those API to serve my purpose. The frontend code(<strong>Auth.signIn</strong> and <strong>Auth.sendCustomChallengeAnswer</strong>) works great but using same code the <strong>verify auth API</strong> is not working. Sharing my code.</p>
  <p><strong>Sign In API:</strong></p>
  <pre><code>await Auth.signIn(phone);
  </code></pre>
  <p><strong>Verify Auth API:</strong> (Returned <strong>c['Session']</strong> from DynamoDB which is stored in during signIn)</p>
  <pre><code>    let otp = body['otp'];
      const poolData = {
          UserPoolId: '------ pool id -------',
          ClientId: '------ client id -------'
      };
      const userPool = new CognitoUserPool(poolData);
      const userData = {
          Username: '+12014222656',
          Pool: userPool
      };
      this.cognitoUser1 = new CognitoUser(userData);
      this.cognitoUser1['Session'] = c['Session'];
  
      await Auth.sendCustomChallengeAnswer(this.cognitoUser1, otp);
      const tokenDetails = await Auth.currentSession()
  
      response = {
          'statusCode': 201,
          'body': JSON.stringify({
              message: 'Verification successful',
              body:tokenDetails
          })
      }
  </code></pre>
  <p>After debugging frontend <strong>Auth.signIn</strong> response and Lambda API <strong>Auth.signIn</strong> response i investigated that an extra &quot;<strong>storage</strong>&quot; object returned when signing in from frontend and appended on <strong>this.cognitoUser1</strong> before sending through <strong>Auth.sendCustomChallengeAnswer</strong> . See the attached screenshot below: <a href="https://i.stack.imgur.com/buOlp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/buOlp.png" alt="Screenshot of response" /></a>
  Is this the reason for successful verifying OTP from frontend? If so, what about making API (using Lambda and API gateway) and where it stores this storage object. Stuck here. Any suggestion and help will be appreciated.</p>