Skip to content

Commit

Permalink
use process.nextTick with callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
wlaurance committed Aug 24, 2012
1 parent 6ceb3e1 commit aeaf6ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lib/session-oauth.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/session-oauth.coffee
Expand Up @@ -15,7 +15,8 @@ class SessionOAuth extends Session
temp_token = code.split('=')[1]
@requestPermanentAccessToken temp_token, (@persistent_token)=>
@registerOAuthToken()
do cb
process.nextTick ->
do cb

requestPermanentAccessToken:(temp_token, cb)->
params = "client_id=#{@api_key}&client_secret=#{@secret}&code=#{temp_token}"
Expand All @@ -24,7 +25,8 @@ class SessionOAuth extends Session
throw err
return
response = JSON.parse response
cb response.access_token
process.nextTick ->
cb response.access_token


site:()->
Expand Down

0 comments on commit aeaf6ff

Please sign in to comment.