Commit 552d22be authored by takayamaki's avatar takayamaki Committed by Eugen Rochko
Browse files

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

parent 7c33da45
......@@ -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
......
......@@ -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)
......
......@@ -3,7 +3,7 @@
- content_for :header_tags do
= javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous'
= render partial: 'og'
= render partial: 'shared/og'
.landing-page
.header-wrapper.compact
......
......@@ -4,7 +4,7 @@
- content_for :header_tags do
%script#initial-state{ type: 'application/json' }!= json_escape(@initial_state_json)
= javascript_pack_tag 'about', integrity: true, crossorigin: 'anonymous'
= render partial: 'og'
= render partial: 'shared/og'
.landing-page
.header-wrapper
......
- content_for :page_title do
= t('auth.register')
- content_for :header_tags do
= render partial: 'shared/og'
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= render 'shared/error_messages', object: resource
......
- content_for :page_title do
= t('auth.login')
- content_for :header_tags do
= render partial: 'shared/og'
= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
= f.input :email, autofocus: true, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email') }
= f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment