PoGoBag icon indicating copy to clipboard operation
PoGoBag copied to clipboard

Receiving NoMethodError (undefined method `upcase' for nil:NilClass) when trying to use google api login local

Open valmedia opened this issue 9 years ago • 2 comments

F, [2016-08-09T16:21:06.060061 #20511] FATAL -- : [682af70f-08fa-4184-b16c-533016d350b1] NoMethodError (undefined method 'upcase' for nil:NilClass):
F, [2016-08-09T16:21:06.060112 #20511] FATAL -- : [682af70f-08fa-4184-b16c-533016d350b1]   
F, [2016-08-09T16:21:06.060146 #20511] FATAL -- : [682af70f-08fa-4184-b16c-533016d350b1] app/helpers/sessions_helper.rb:224:in 'get_call'
F, [2016-08-09T16:21:06.060197 #20511] FATAL -- : [682af70f-08fa-4184-b16c-533016d350b1] app/helpers/sessions_helper.rb:126:in 'get_player_info'
F, [2016-08-09T16:21:06.060237 #20511] FATAL -- : [682af70f-08fa-4184-b16c-533016d350b1] app/helpers/sessions_helper.rb:164:in 'setup_client_user_pair'
F, [2016-08-09T16:21:06.060263 #20511] FATAL -- : [682af70f-08fa-4184-b16c-533016d350b1] app/helpers/sessions_helper.rb:156:in 'setup_user'
F, [2016-08-09T16:21:06.060293 #20511] FATAL -- : [682af70f-08fa-4184-b16c-533016d350b1] app/controllers/sessions_controller.rb:10:in 'create'
/usr/local/rvm/gems/ruby-2.3.0/bundler/gems/poke-api-0f56647618ab/lib/poke-api/client.rb:23:in 'login'
/usr/local/rvm/gems/ruby-2.3.0/bundler/gems/poke-api-0f56647618ab/lib/poke-api/client.rb:98:in 'check_expiry'
/usr/local/rvm/gems/ruby-2.3.0/bundler/gems/poke-api-0f56647618ab/lib/poke-api/client.rb:42:in 'call'
app/helpers/sessions_helper.rb:224:in 'get_call'
app/helpers/sessions_helper.rb:126:in 'get_player_info'

Not sure if it is a problem of poke-api or pogobag.

valmedia avatar Aug 09 '16 21:08 valmedia

Oops, this might actually be related to poke-api, I may have inadvertently introduced an old bug that was fixed. For now you can avoid it by not calling the provider with all caps.

Edit: Okay, it's actually more related to the recent changes to implement automatic token refresh. Since this client doesn't login the normal way (using login) it doesn't have @provider set for example, so it's trying to call upcase on nil. In the next version I'll have it changed so you can provide an access token directly.

Edit: 2 You can now provide a google refresh token directly using client.refresh_token = 'foo' and invoke login such as client.login('', '', 'google'), and it'll handle the rest for you.

nabeelamjad avatar Aug 09 '16 21:08 nabeelamjad

Weird seems to be quite buggy for local installation. Now gets user/password invalid and calling login_error_ptc.

valmedia avatar Aug 10 '16 04:08 valmedia