set origin for login

This commit is contained in:
Konstantin Haase 2012-09-22 17:46:29 +02:00
parent 9845c7473e
commit 4dfe5f70eb
4 changed files with 1511 additions and 1510 deletions

View File

@ -34,7 +34,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-api.git
revision: 5d908480c7170a84aebb80b0d0a0398295a207f2
revision: 07038cd7a5426180f9c5d8497d7713439073095b
branch: sf-use-services
specs:
travis-api (0.0.1)

View File

@ -2,6 +2,7 @@
iframe: $('<iframe id="auth-frame" />').hide()
timeout: 5000
state: 'signed-out'
receivingEnd: "#{location.protocol}//#{location.host}"
init: ->
@iframe.appendTo('body')
@ -23,7 +24,7 @@
trySignIn: ->
@set('state', 'signing-in')
@iframe.attr('src', "#{@endpoint}/auth/post_message")
@iframe.attr('src', "#{@endpoint}/auth/post_message?origin=#{@receivingEnd}")
checkSignIn: ->
@forceSignIn() if @get('state') == 'signing-in'
@ -61,4 +62,4 @@
console.log("unexpected message #{event.origin}: #{event.data}")
expectedOrigin: ->
if @endpoint[0] == '/' then "#{location.protocol}//#{location.host}" else @endpoint
if @endpoint[0] == '/' then @receivingEnd else @endpoint

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff