aws-samples / amazon-cognito-passwordless-auth

Passwordless authentication with Amazon Cognito: FIDO2 (WebAuthn, support for Passkeys), Magic Link, SMS OTP Step Up
Apache License 2.0
385 stars 70 forks source link

Fix/usernotfound #214

Closed ottokruse closed 4 days ago

ottokruse commented 4 days ago

Issue #, if available: #213 #200

Description of changes: Fixed a regression caused by https://github.com/aws-samples/amazon-cognito-passwordless-auth/commit/031d702ffea11c2f9d6fa359eca8e18bc5a91ed4

The CreateAuthChallenge trigger must always have at least one property in the privateChallengeParameters or Cognito will throw "Invalid username or password". Have now added a dummy value there, because the magic link implementation doesn't use the privateChallengeParameters anyway. Also added some random wait time.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.