title: InvalidLambdaResponseException - Unrecognizable lambda output when sign in without password with amplify
body: <p>I am developing a custom auth flow in aws cognito with lambda triggers.</p>
  
  <p>I used the sample code given by aws for lambda triggers <code>DefineAuthChallenge_Authentication</code>, <code>CreateAuthChallenge_Authentication</code> and <code>VerifyAuthChallenge_Authentication</code>, It's even explained in this answer,
  <a href="https://stackoverflow.com/questions/45666794/aws-cognito-user-pool-without-a-password/45667935#45667935">AWS Cognito User Pool without a password</a></p>
  
  <p>But when I sign in from frontend with amplify it says 
  <code>{code: "InvalidLambdaResponseException", name: "InvalidLambdaResponseException", message: "Unrecognizable lambda output"}</code></p>
  
  <p>After the Define auth challenge when create auth challenge is invoked the challenge is not in the event.request.session, it's an empty array. The challengeName attribute is just there in the event.response as following,</p>
  
  <pre><code>triggerSource: 'CreateAuthChallenge_Authentication',
  request: 
  { userAttributes: 
  { sub: 'xxxxx-xxxxx-xxxx',
  'cognito:user_status': 'CONFIRMED',
  name: 'sala',
  phone_number_verified: 'true',
  'cognito:phone_number_alias': '+947xxxxxxxxx',
  phone_number: '+947xxxxxxxxx' },
  challengeName: 'CUSTOM_CHALLENGE',
  session: [] },
  </code></pre>
  
  <p>Following is my define auth challenge,
  `</p>
  
  <pre><code>exports.handler = async event =&gt; {
    if (
      event.request.session &amp;&amp;
      event.request.session.length &gt;= 3 &amp;&amp;
      event.request.session.slice(-1)[0].challengeResult === false
    ) {
      // The user provided a wrong answer 3 times; fail auth
      event.response.issueTokens = false;
      event.response.failAuthentication = true;
    } else if (
      event.request.session &amp;&amp;
      event.request.session.length &amp;&amp;
      event.request.session.slice(-1)[0].challengeResult === true
    ) {
      // The user provided the right answer; succeed auth
      event.response.issueTokens = true;
      event.response.failAuthentication = false;
    } else {
      // The user did not provide a correct answer yet; present challenge
      event.response.issueTokens = false;
      event.response.failAuthentication = false;
      event.response.challengeName = 'CUSTOM_CHALLENGE';
    }
    return event;
  };
  </code></pre>