janko / rodauth-rails

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

/verify-account path in API only app #172

Closed bvicenzo closed 1 year ago

bvicenzo commented 1 year ago

Hi! I've found that gem and loved it. Thanks.

I'm trying to build an API-only rails app using that gem using that guide: https://github.com/janko/rodauth-rails/wiki/JSON-API

However, after creating an account and receiving the email to verify that account, when I click in the link, I receive this message: Only JSON format requests are allowed.

How could I proceed to verify an account in an API-only Rails app?

Thanks again!

janko commented 1 year ago

Hi, I'm glad you like it! 🙂

This was already asked in https://github.com/janko/rodauth-rails/discussions/167. In short, email links such as account verification should be routed by your frontend app, which should then make a JSON request to the POST endpoint with the key from the email link. There is an example of this JSON request in the demo app README.

In the future, GitHub Discussions is preferred for usage questions, issues should only be used for bug reports 😉

bvicenzo commented 1 year ago

Nice, I'll take a look at that. Thanks, for your time.