lib/warden-github/strategy.rb in warden-github-0.2.0 vs lib/warden-github/strategy.rb in warden-github-0.2.1
- old
+ new
@@ -9,10 +9,10 @@
if params['code']
begin
access_token = access_token_for(params['code'])
user = JSON.parse(access_token.get('/api/v2/json/user/show'))
success!(Warden::Github::Oauth::User.new(user['user'], access_token.token))
- rescue OAuth2::HTTPError
+ rescue OAuth2::Error
%(<p>Outdated ?code=#{params['code']}:</p><p>#{$!}</p><p><a href="/auth/github">Retry</a></p>)
end
else
env['rack.session']['return_to'] = env['REQUEST_URI']
throw(:warden, [ 302, {'Location' => authorize_url}, [ ]])