add auth timeout
This commit is contained in:
parent
5f8c5f5798
commit
f3f9d98e6b
|
@ -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)
|
||||
|
|
|
@ -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
Loading…
Reference in New Issue
Block a user