Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to use for user registration when creating a Rails 5 API-Only app?

There are plenty of articles and resources out there about different options for authenticating and accessing a user's information via a Rails 5 API, such as Knock, Doorkeeper, JWT, etc, but I am having trouble finding a solid recommendation on how to handle the actual registration of a new user and related features (i.e. password requests).

I could use Devise, but I wonder if it's overkill. In fact, many articles dealing with JWT, as well as gems like Knock, recommend against it.

Is there a different recommended solution for handling new user registration when building a Rails 5 API only application or is Devise still the best way to go here, even with all the other overhead? Does Rails 5 have something built in?

like image 892
JoshL Avatar asked Oct 30 '22 18:10

JoshL


1 Answers

I`m in the same situation like you I wanted to build a rails 5 api and use JWT but a all the articles omits the register part :S I though like you on use Devise but we only need the register part we wouldn't need the authentication and other modules that are on devise, so the solution would be add register functionality from scratch or if you don't want to code something from scratch then you can use devise but modified to work along with token authentication see this wiki post

like image 69
rome3ro Avatar answered Nov 15 '22 05:11

rome3ro