0
0
Fork 0

sign_in and sign_up views present og meta infos (#5308)

This commit is contained in:
takayamaki 2017-10-11 07:52:25 +09:00 committed by Eugen Rochko
parent 7c33da45f0
commit 552d22bec9
7 changed files with 18 additions and 2 deletions

View file

@ -6,6 +6,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
before_action :check_enabled_registrations, only: [:new, :create]
before_action :configure_sign_up_params, only: [:create]
before_action :set_sessions, only: [:edit, :update]
before_action :set_instance_presenter, only: [:new, :update]
def destroy
not_found
@ -39,6 +40,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController
private
def set_instance_presenter
@instance_presenter = InstancePresenter.new
end
def determine_layout
%w(edit update).include?(action_name) ? 'admin' : 'auth'
end

View file

@ -8,6 +8,7 @@ class Auth::SessionsController < Devise::SessionsController
skip_before_action :require_no_authentication, only: [:create]
skip_before_action :check_suspension, only: [:destroy]
prepend_before_action :authenticate_with_two_factor, if: :two_factor_enabled?, only: [:create]
before_action :set_instance_presenter, only: [:new]
def create
super do |resource|
@ -84,6 +85,10 @@ class Auth::SessionsController < Devise::SessionsController
private
def set_instance_presenter
@instance_presenter = InstancePresenter.new
end
def home_paths(resource)
paths = [about_path]
if single_user_mode? && resource.is_a?(User)