passkey plugin's endpoint `generate-register-options` gives me 401
A fresh new project. Followed exactly the guide on the website. Not sure if i missed anything.

7 Replies
wait... i think i know what's wrong.
To add or register a passkey make sure a user is authenticated and then call the passkey.addPasskey function provided by the client.so the user have to setup an account first then add passkey? is there a way to register with a passkey?
no. the user need to register using another method first.
thank you. i'm currently register a annoymous user first for the current user, then the user can add passkey themself. works pretty well. is there any pitfall here?
how do you make an anonymous user? Do you signup an email with a random password first or is there any other method for this?
you can use this plugin https://www.better-auth.com/docs/plugins/anonymous
Anonymous | Better Auth
Anonymous plugin for Better Auth.
So, I tried this, but when I use an anonymous user and then creating a passkey, it tries to save the anonymous email to the user's keychain, which is not ideal. Ideally on this screen the user's provided email should be shown. Is it possible to do? All I can think is to register the user with a default generated password then show them the passkey's registration prompts and use the generated password as a fallback.

All I can think is to register the user with a default generated passwordif you don't want the generated email but user provided one, that's the only way i think