Permalink
Browse files

Fix authentication

Turns out we can't be eager in calling rtm.auth.getToken if the user has
not previously authenticated us.
  • Loading branch information...
1 parent d2bc16d commit ce8e444db0a32b2b9499d0d14a7fa32a069f3ad8 @tpope committed Sep 20, 2010
Showing with 3 additions and 9 deletions.
  1. +3 −9 lib/rumember.rb
View
@@ -86,15 +86,9 @@ def authenticate
frob = dispatch('auth.getFrob')['frob']
Launchy.open(auth_url(:delete, 'frob' => frob))
first = true
- begin
- dispatch('auth.getToken', 'frob' => frob)['auth']
- rescue ResponseError => e
- puts e.message unless first
- puts 'Press enter when authentication is complete'
- $stdin.gets
- first = false
- retry
- end
+ puts 'Press enter when authentication is complete'
+ $stdin.gets
+ dispatch('auth.getToken', 'frob' => frob)['auth']
end
def reconfigure

0 comments on commit ce8e444

Please sign in to comment.