FIX: Flash authentication data not rendered in latest iOS safari browser

This commit is contained in:
Vinoth Kannan 2018-10-30 04:00:36 +05:30
parent f8305f53c7
commit 92bf3c667e
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>