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.
No description
7 Replies
Songkeys
SongkeysOP3w ago
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?
bekacru
bekacru3w ago
no. the user need to register using another method first.
Songkeys
SongkeysOP3w ago
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?
Jim-Y
Jim-Y2w ago
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?
Mukund
Mukund2w ago
Anonymous | Better Auth
Anonymous plugin for Better Auth.
Jim-Y
Jim-Y2w ago
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.
No description
Songkeys
SongkeysOP2w ago
All I can think is to register the user with a default generated password
if you don't want the generated email but user provided one, that's the only way i think

Did you find this page helpful?