alexanderson1993 / remix-auth-webauthn

A Remix Auth strategy for signing in with Web Authentication passkeys.
MIT License
80 stars 9 forks source link

Issue with nanoid #22

Open parkerdevs opened 2 months ago

parkerdevs commented 2 months ago

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 commented 1 week ago

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)