Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data] Fix WebAuthn Authenticate #36

Merged
merged 3 commits into from
Mar 19, 2023

Conversation

horus
Copy link
Contributor

@horus horus commented Mar 7, 2023

Hello,

I've noticed that

      <#if authenticators??>
        <form x-ref="authnSelectForm">
          <#list authenticators.authenticators as authenticator>
            <input value="${authenticator.credentialId}" type="hidden" />
          </#list>
        </form>

There are some circumstances which an user instance's not required (i.e., passwordless), thus authenticators will evaluate to null, which further cause the form being skipped entirely.

According to the code in webauthn-authenticate.ftl#L95, the authnSelectForm should be checked.
Otherwise it will result in error:

Uncaught TypeError: can't access property "elements", l is undefined

This PR tries to address the issue. Thank you!

@lukin
Copy link
Owner

lukin commented Mar 19, 2023

Hey @horus 👋

Thank you for your contribution. I'll prepare a build for this fix.

@lukin lukin changed the title Fix: handle possibly undefined authnSelectForm [data] Fix WebAuthn Authenticate Mar 19, 2023
@lukin lukin merged commit d3836c0 into lukin:master Mar 19, 2023
@horus
Copy link
Contributor Author

horus commented Mar 20, 2023

Glad I could be of help!
Thank you for creating and maintaining this.

lukin added a commit that referenced this pull request Oct 24, 2023
Co-authored-by: Anthony Lukin <anthony@lukin.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants