janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
565 stars 40 forks source link

How to pass additional attributes to /create-account #274

Closed jesseduffield closed 5 months ago

jesseduffield commented 5 months ago

Currently, I create an account by calling /create-account (JSON API) but it only accepts email/password. I'd like to pass some additional attributes (user firstname/lastname) in that request and have them stored in a separate users table which points to the accounts table.

How should I go about that? If it's not possible with the /create-account endpoint, I could use the create_account library method directly from within my own endpoint, but I'm not sure whether in doing so I'd be giving up on some rate-limiting middleware in the default endpoint.

Thanks

jesseduffield commented 5 months ago

Ah, I see I need to use the before_create_account and after_create_account hooks. Closing!