From 2b3579e6ddc45404c0bcbdb17113b7a106de2db4 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Sat, 17 Nov 2012 17:55:21 +0100 Subject: [PATCH] first stab at a popup flow --- lib/travis/api/app/endpoint/authorization.rb | 46 ++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/lib/travis/api/app/endpoint/authorization.rb b/lib/travis/api/app/endpoint/authorization.rb index c37dd484..9787d13a 100644 --- a/lib/travis/api/app/endpoint/authorization.rb +++ b/lib/travis/api/app/endpoint/authorization.rb @@ -116,6 +116,12 @@ class Travis::Api::App # recommended to redirect to [/auth/handshake](#/auth/handshake) if no # token is being received. get '/post_message', scope: :public do + content_type :html + response.set_cookie('cookie_check', '1') + erb :container + end + + get '/post_message/iframe', scope: :public do handshake do |user, token, target_origin| halt 403, invalid_target(target_origin) unless target_ok? target_origin rendered_user = Travis::Api.data(user, version: :v2) @@ -254,20 +260,34 @@ __END__ alert('refusing to send a token to <%= target_origin.inspect %>, not whitelisted!'); -@@ post_message +@@ container + +@@ post_message +