Merge branch 'sf-auth-iframe' of github.com:travis-ci/travis-ember into sf-auth-iframe

This commit is contained in:
Sven Fuchs 2012-09-18 21:04:00 +02:00
commit 437533641e
3 changed files with 10 additions and 3 deletions

View File

@ -22,7 +22,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-api.git
revision: 1e903129a31ab7785e17562740d0bfb69486e2f3
revision: 1a7a9daf4643abf6c954bf26c63816783ded9bda
branch: sf-use-services
specs:
travis-api (0.0.1)

View File

@ -30,6 +30,13 @@ $.extend Travis.Auth.prototype,
trySignIn: ->
@iframe.attr('src', "#{Travis.config.api_endpoint}/auth/post_message")
newUser: ->
url = "#{Travis.config.api_endpoint}/auth/handshake?redirect_uri=#{window.location}"
window.location = url
checkUser: ->
@newUser() unless Travis.config.access_token?
signIn: ->
@trySignIn()
# TODO: timeout for redirect goes here
window.setTimeout((=> @checkUser()), 15000)

File diff suppressed because one or more lines are too long