janko / rodauth-rails

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

ActionMailer is required #148

Closed mculp closed 1 year ago

mculp commented 2 years ago

uninitialized constant Rodauth::Rails::Feature::Email::ActionMailer

It seems like the features.rb file is requiring features even if they are turned off.

I'm going to be the sole user of this app, create my user via db, and I don't need any features aside from login and logout. My use case is that I only want login/logout.

irb(main):007:0> require 'rodauth/rails/feature'
Traceback (most recent call last):
rodauth-rails-1.5.5/lib/rodauth/rails/feature/email.rb:22:in `<module:Email>': uninitialized constant Rodauth::Rails::Feature::Email::ActionMailer (NameError)
janko commented 2 years ago

Thanks for reporting, I agree we should make rodauth-rails work without Action Mailer. I think if we don't load Rodauth::Rails::Feature::Email, and don't generate the mailer and the corresponding Rodauth configuration when Action Mailer is not loaded, that should be enough. Would you feel comfortable working on a PR for that?