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
367 stars 63 forks source link

`Error: Missing Fido2 config` when not providing `fido2` object to `Config` #128

Closed brno32 closed 9 months ago

brno32 commented 9 months ago

I have the following config

Passwordless.configure({
    cognitoIdpEndpoint: `${process.env.USER_POOL_REGION}`,
    userPoolId: `${process.env.USER_POOL_ID}`,
    clientId: `${process.env.USER_POOL_CLIENT_ID}`
})

I'm intentionally not passing a fido2 object because I only want to use the functionality around the Magic Link Sign-In.

However, the above gives me the following error

Error: Missing Fido2 config

Looking at the code, I can see why. If fido2 isn't defined, it throws this error.

Am I reading this, right? The documentation says using fido is optional, but clearly it's required

ottokruse commented 9 months ago

Should be optional, so that's a bug. Thanks for the report! If you're interested to send a PR?

brno32 commented 9 months ago

Sure!

ottokruse commented 9 months ago

Fix released in https://github.com/aws-samples/amazon-cognito-passwordless-auth/releases/tag/v0.12.1