Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

User creation didn't set login and github_id #103

Closed
werebus opened this issue May 24, 2017 · 1 comment
Closed

User creation didn't set login and github_id #103

werebus opened this issue May 24, 2017 · 1 comment

Comments

@werebus
Copy link

werebus commented May 24, 2017

I ran into something at least somewhat similar to #102 as well. Although, I think my issue at least was actually on User creation.

From a binding.pry within AuthController#create:

auth_hash['uid'] #=> "240275"
auth_hash['info']['nickname'] #=> "werebus"
auth_hash.credentials['token']. #=> "REDACTED, a 40-character hex string"

But after authorizing with Github, I get an exception:


NoMethodError in Splash#index

Showing /Users/matt/src/boxen-web/app/views/splash/index.html.erb where line 18 raised:

undefined method short_access_token for nil:NilClass
Extracted source (around line #31):

29
30    def script_path
31        "/script/#{@user.short_access_token}.sh"
32      end
33
34     def secondary_message

Rails.root: /Users/matt/src/boxen-web

app/helpers/views/splash/index.rb:31:in `script_path'
app/helpers/views/splash/index.rb:27:in `script_url'
app/views/splash/index.html.erb:18:in `_app_views_splash_index_html_erb___3969017073143433352_70122182167760'
app/controllers/splash_controller.rb:6:in `index'

And looking in my Rails console:

User.first #=> #<User id: 9, login: nil, github_id: nil, created_at: "2017-05-24 14:41:13", updated_at: "2017-05-24 14:41:13", access_token: "REDACTED, same token">

I suspect this is related to the problem that the author of #102 was having, and indeed, applying that PR does fix my issue. Not sure of the cause, exactly. I'm not all that good at Rails.

@jacobbednarz
Copy link
Member

Fixed by #102

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants