27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/omniauth/strategies/rtm.rb', line 27
def callback_phase
raise OmniAuth::NoSessionError.new("Session Expired") if session['oauth'].nil?
rtm_auth.frob = request.params['frob']
@token = rtm_auth.get_token
rtm.token = @token
resp = rtm.check_token
@uid = resp['auth']['user']['id']
@nickname = resp['auth']['user']['username']
@fullname = resp['auth']['user']['fullname']
super
rescue ::Timeout::Error => e
fail!(:timeout, e)
rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
fail!(:service_unavailable, e)
rescue ::RTM::VerificationException => e
fail!(:invalid_credentials, e)
rescue ::OmniAuth::NoSessionError => e
fail!(:session_expired, e)
end
|