From f383a2e1b328d2d21e714d5835afbf43d983996d Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Tue, 3 Dec 2013 16:16:21 +0100 Subject: [PATCH] allow disabling the 3rd party cookies check --- lib/travis/api/app/endpoint/authorization.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/travis/api/app/endpoint/authorization.rb b/lib/travis/api/app/endpoint/authorization.rb index 9745f467..6e2a7aa5 100644 --- a/lib/travis/api/app/endpoint/authorization.rb +++ b/lib/travis/api/app/endpoint/authorization.rb @@ -128,7 +128,8 @@ class Travis::Api::App # token is being received. get '/post_message', scope: :public do content_type :html - erb :container + data = { check_third_party_cookies: !Travis.config.auth.disable_third_party_cookies_check } + erb(:container, locals: data) end get '/post_message/iframe', scope: :public do @@ -382,6 +383,7 @@ function main() { var url = window.location.pathname + '/iframe' + window.location.search; function thirdPartyCookies(yes, no) { + <%= "return no();" unless check_third_party_cookies %> window.cookiesCheckCallback = function(enabled) { enabled ? yes() : no() }; var img = document.createElement('img'); img.src = "https://third-party-cookies.herokuapp.com/set";