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:
Vinoth Kannan 2018-10-30 04:35:07 +05:30 committed by GitHub
commit ead6600f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -454,7 +454,7 @@ class ApplicationController < ActionController::Base
end
def can_cache_content?
current_user.blank? && flash[:authentication_data].blank?
current_user.blank? && cookies[:authentication_data].blank?
end
# Our custom cache method

View File

@ -67,7 +67,7 @@ class Users::OmniauthCallbacksController < ApplicationController
if (provider && provider.full_screen_login) || cookies['fsl']
cookies.delete('fsl')
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
else
respond_to do |format|

View File

@ -56,8 +56,8 @@
<%= tag.meta id: 'data-discourse-setup', data: client_side_setup_data %>
<%- if !current_user && flash[:authentication_data] %>
<meta id="data-authentication" data-authentication-data="<%= flash[:authentication_data] %>">
<%- if !current_user && cookies[:authentication_data] %>
<meta id="data-authentication" data-authentication-data="<%= cookies.delete(:authentication_data) %>">
<%= preload_script "authentication-complete" %>
<%- end %>
</head>