Fix login page linking to other pages within OAuth authorization flow (#36115)
This commit is contained in:
@@ -260,6 +260,10 @@ module ApplicationHelper
|
|||||||
'https://play.google.com/store/apps/details?id=org.joinmastodon.android'
|
'https://play.google.com/store/apps/details?id=org.joinmastodon.android'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def within_authorization_flow?
|
||||||
|
session[:user_return_to].present? && Rails.application.routes.recognize_path(session[:user_return_to])[:controller] == 'oauth/authorizations'
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def storage_host_var
|
def storage_host_var
|
||||||
|
|||||||
@@ -41,4 +41,5 @@
|
|||||||
- resource_class.omniauth_providers.each do |provider|
|
- resource_class.omniauth_providers.each do |provider|
|
||||||
= provider_sign_in_link(provider)
|
= provider_sign_in_link(provider)
|
||||||
|
|
||||||
.form-footer= render 'auth/shared/links'
|
- unless within_authorization_flow?
|
||||||
|
.form-footer= render 'auth/shared/links'
|
||||||
|
|||||||
@@ -5,8 +5,11 @@
|
|||||||
.container-alt
|
.container-alt
|
||||||
.logo-container
|
.logo-container
|
||||||
%h1
|
%h1
|
||||||
= link_to root_path do
|
- if within_authorization_flow?
|
||||||
= logo_as_symbol(:wordmark)
|
= logo_as_symbol(:wordmark)
|
||||||
|
- else
|
||||||
|
= link_to root_path do
|
||||||
|
= logo_as_symbol(:wordmark)
|
||||||
|
|
||||||
.form-container
|
.form-container
|
||||||
= render 'flashes'
|
= render 'flashes'
|
||||||
|
|||||||
Reference in New Issue
Block a user