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

Issue with nanoid #22

Open
parkerdevs opened this issue Aug 20, 2024 · 1 comment
Open

Issue with nanoid #22

parkerdevs opened this issue Aug 20, 2024 · 1 comment

Comments

@parkerdevs
Copy link

It looks like the nanoid function is generating a value that is no longer compatible with @SimpleWebAuthn startRegistration() function. From what I can tell, the value options.user.id should be base64url-encoded UTF-8 bytes when passed into startRegistration().

SimpleWebAuthn - Custom User IDs

@ferdinandlist
Copy link

ferdinandlist commented Oct 13, 2024

I also ran into this and created a workaround in a copy of handleFormSubmit:

id: btoa(config?.generateUserId?.() || nanoid());

I guess actually supplying a custom generateUserId using btoa() in the same manner would also work as a temporary workaround.

(Just leaving this here in case someone gets stuck looking for a fix)

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

No branches or pull requests

2 participants