Adding devise_token_auth to an existing Rails app

19-Jul-2019 2105
Ruby on rails is still the frontrunner for getting an MVP(minimum viable product) out of the door. Eventual when things go our way we want to introduce F/E framework on the customer facing side for various reasons(continue using the admin part as traditional rails app). If you are already using devise and wondering how to use it for api calls this post is for you.The devise_token_auth is a gem on top of devise which works with tokens and leverages on devise. We can even configure it to either refresh the token for every single request or not.Without further delay let’s jump in.Add the following to your Gemfile. We need rack-cors to get support for Cross-Origin Resource Sharing (CORS).
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle