set origin for login
This commit is contained in:
parent
9845c7473e
commit
4dfe5f70eb
|
@ -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)
|
||||
|
|
|
@ -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
Loading…
Reference in New Issue
Block a user