Closed juan-apa closed 1 year ago
Thanks for reporting, I forgot to update the Rodauth config after making configuration name a required argument in RodauthMailer
(https://github.com/janko/rodauth-rails/commit/523c2a01f7b4fa9413af66676bed410728587444). I will push a fix shortly, and probably a new release.
thanks for the quick reply!
Description
I just created a new rails 7 --api app to try out rodauth auth method, and I have an issue with the default install. When trying to create an account via the api, the email fails to send with the following message:
I tracked this issue to the splat operator in
RodauthMain -> configure -> create_verify_account_email
. Whenself.class.configuration_name
returns empty, the splat operator changed the arity of the method call from 3 to 2. So instead of calling:it calls
which fails in runtime, and does not send the email, so an account can never be verified.
Solution
The solution to this was to create a method in
RodauthMain
after theconfigure do ... end
:Then in the configure block, the methods that call the mailer, then call:
RodauthMailer.verify_account(configuration_name, account_id, verify_account_key_value)
instead ofRodauthMailer.verify_account(*self.class.configuration_name, account_id, verify_account_key_value)
(make this change to every mailer method called from this class.)I'm not sure of the repercussions of removing the splat operator when multiple configurations for rodauth are setup, so this fix may not work for you.