title: AWS Cognito Pre authentication/Define Auth Challenge lambda hooks are not invoked if user doesn't exist
body: <p><a href="https://i.stack.imgur.com/l8bw4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l8bw4.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/agOTn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/agOTn.png" alt="enter image description here"></a></p>
  
  <p>I'm essentially trying to create a middleware that will do some work before logging a user in. However, none of the lambda hooks run when I try to log in with a user that doesn't exist in aws cognito.</p>