diff --git a/app/controllers/devise/passwordless/sessions_controller.rb b/app/controllers/devise/passwordless/sessions_controller.rb index c04a50d..764ccf1 100644 --- a/app/controllers/devise/passwordless/sessions_controller.rb +++ b/app/controllers/devise/passwordless/sessions_controller.rb @@ -1,7 +1,7 @@ class Devise::Passwordless::SessionsController < Devise::SessionsController def create if (self.resource = resource_class.find_for_authentication(email: create_params[:email])) - resource.send_magic_link(remember_me: create_params[:remember_me]) + send_magic_link(resource) if Devise.paranoid set_flash_message!(:notice, :magic_link_sent_paranoid) else @@ -23,6 +23,10 @@ def create protected + def send_magic_link(resource) + resource.send_magic_link(remember_me: create_params[:remember_me]) + end + def translation_scope if action_name == "create" "devise.passwordless"