Merge pull request #6540 from vinothkannans/ios-safari-fix
FIX: Flash authentication data not rendered in latest iOS safari browser
This commit is contained in:
commit
ead6600f4b
|
@ -454,7 +454,7 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_cache_content?
|
def can_cache_content?
|
||||||
current_user.blank? && flash[:authentication_data].blank?
|
current_user.blank? && cookies[:authentication_data].blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Our custom cache method
|
# Our custom cache method
|
||||||
|
|
|
@ -67,7 +67,7 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||||
if (provider && provider.full_screen_login) || cookies['fsl']
|
if (provider && provider.full_screen_login) || cookies['fsl']
|
||||||
cookies.delete('fsl')
|
cookies.delete('fsl')
|
||||||
cookies['_bypass_cache'] = true
|
cookies['_bypass_cache'] = true
|
||||||
flash[:authentication_data] = @auth_result.to_client_hash.to_json
|
cookies[:authentication_data] = @auth_result.to_client_hash.to_json
|
||||||
redirect_to @origin
|
redirect_to @origin
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
|
@ -56,8 +56,8 @@
|
||||||
|
|
||||||
<%= tag.meta id: 'data-discourse-setup', data: client_side_setup_data %>
|
<%= tag.meta id: 'data-discourse-setup', data: client_side_setup_data %>
|
||||||
|
|
||||||
<%- if !current_user && flash[:authentication_data] %>
|
<%- if !current_user && cookies[:authentication_data] %>
|
||||||
<meta id="data-authentication" data-authentication-data="<%= flash[:authentication_data] %>">
|
<meta id="data-authentication" data-authentication-data="<%= cookies.delete(:authentication_data) %>">
|
||||||
<%= preload_script "authentication-complete" %>
|
<%= preload_script "authentication-complete" %>
|
||||||
<%- end %>
|
<%- end %>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in New Issue