Migrating from Devise to Rodauth, Rspec

If you want to read about migrating a basic Rails application from Devise to Rodauth, go to Basics. Removing Devise When writing controller or feature tests, you usually have a file in spec/support/devise.rb. It includes Devise test helpers, you can use sign_in @user in your RSpec tests. You can remove the file entirely: - RSpec.configure do |config| - config.include Devise::Test::ControllerHelpers, type: :controller - config.include Devise::Test::ControllerHelpers, type: :view - end Updating the specs Sadly, Rodauth doesn’t have an easy helper for the tests and recommends performing the authentication through the normal requests....

April 19, 2025 · Codefabrik GmbH

Migrating from Devise to Rodauth, Basics

Devise has been my go-to authentication library for as long as I can remember. Recently, though, I had requirements that were incompatible with Devise. Namely, to allow authentication both from a HTML frontend via session cookies, and via JWT from a mobile app. Apparently, Rodauth supports that use case and many more. This post explains the minimal steps to migrate from Devise to Rodauth in a Rails application, while the other posts of the series explain advanced topics when special Devise features were in use....

April 19, 2025 · Codefabrik GmbH