FIX: Use a cookie to bypass the anon cache
This commit is contained in:
parent
db5379508e
commit
a9823ab59a
|
@ -57,6 +57,7 @@ class Users::OmniauthCallbacksController < ApplicationController
|
|||
complete_response_data
|
||||
|
||||
if provider && provider.full_screen_login
|
||||
cookies['_bypass_cache'] = true
|
||||
flash[:authentication_data] = @auth_result.to_client_hash.to_json
|
||||
redirect_to @origin
|
||||
else
|
||||
|
|
|
@ -64,8 +64,13 @@ module Middleware
|
|||
CurrentUser.has_auth_cookie?(@env)
|
||||
end
|
||||
|
||||
def no_cache_bypass
|
||||
request = Rack::Request.new(@env)
|
||||
request.cookies['_bypass_cache'].nil?
|
||||
end
|
||||
|
||||
def cacheable?
|
||||
!!(!has_auth_cookie? && get?)
|
||||
!!(!has_auth_cookie? && get? && no_cache_bypass)
|
||||
end
|
||||
|
||||
def cached
|
||||
|
|
Loading…
Reference in New Issue