Fixed bug introduced in a9e65fc687

* /auth/confirmations/new and /auth/password/new had no "hero" function
 nor instance_presenter for using it
This commit is contained in:
nogafam.es Admin 2021-10-23 19:35:13 +02:00
parent db7efe00de
commit 07bc4ed6f2
2 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,7 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController
layout 'auth'
before_action :set_body_classes
before_action :set_instance_presenter
before_action :require_unconfirmed!
skip_before_action :require_functional!
@ -26,6 +27,10 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController
@body_classes = 'lighter'
end
def set_instance_presenter
@instance_presenter = InstancePresenter.new
end
def after_resending_confirmation_instructions_path_for(_resource_name)
if user_signed_in?
if current_user.confirmed? && current_user.approved?

View File

@ -3,6 +3,7 @@
class Auth::PasswordsController < Devise::PasswordsController
before_action :check_validity_of_reset_password_token, only: :edit
before_action :set_body_classes
before_action :set_instance_presenter
layout 'auth'
@ -28,6 +29,10 @@ class Auth::PasswordsController < Devise::PasswordsController
@body_classes = 'lighter'
end
def set_instance_presenter
@instance_presenter = InstancePresenter.new
end
def reset_password_token_is_valid?
resource_class.with_reset_password_token(params[:reset_password_token]).present?
end