ambethoney / Network.ly

1 stars 1 forks source link

Dribbble API OAuth Not Directing #6

Open ambethoney opened 9 years ago

ambethoney commented 9 years ago

Hi, I wrote all of my code to get my Dribbble API working in a different file, just to prevent breaking anything in my project. And I have it working! It shows the information that I'm calling (yay!).

Now I'm trying to merge the new code in with my previous code. The issue I'm having now is signing into Dribbble from the dashboard. Whenever I click "Sign Up With Dribbble" I receive this error:

<NoMethodError: undefined method `reject!' for nil:NilClass>

sinatra.route
GET /home

The reject method is in my linkedin_database helper file. I'm confused as to why this would be affecting my Dribbble Login. I've tried playing around with the order of my methods, but I haven't made much headway. Do you have any ideas or suggestions? Thanks!

vanderhoop commented 9 years ago

Hey Angelina, can you post more of the Error message? It's hard to tell exactly what the error is.

ambethoney commented 9 years ago

I’m not really sure what else to send you… I don’t get an error in the terminal, just a Sinatra Error. This is exactly what I’m getting:

NoMethodError at /home undefined method `join' for #String:0x007fd33dc7a5e8

Ruby /Users/ambethoney/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb: in rescue in call, line 37 Web GET localhost/home

sinatra.error

<NoMethodError: undefined method `reject!' for nil:NilClass>

sinatra.route
GET /home

I’m not sure if you saw my original GitHub issue, but I wrote in there exactly where the reject method is being used (in LinkedInHelper). I’m not sure why that would be affecting my ability to log into Dribble

On Jan 17, 2015, at 6:12 PM, Travis Vander Hoop notifications@github.com wrote:

Hey Angelina, can you post more of the Error message? It's hard to tell exactly what the error is.

— Reply to this email directly or view it on GitHub https://github.com/ambethoney/linkedin_oauth/issues/6#issuecomment-70388731.

phlco commented 9 years ago

What does your get '/home' route look like? Let's some some code blocks inhere.

ambethoney commented 9 years ago

get '/home' do
      # get user's contacts from LinkedIn API
      @contacts = get_contacts(session[:access_token])

      # DRIBBBLE PARAMS
      query_params = URI.encode_www_form({
        :client_id     => ENV["DRIBBBLE_OAUTH_ID"],
      })
      @dribbble_auth_url = "https://dribbble.com/oauth/authorize?" + query_params
      @dribbble_user_info = dribbble_user_info
      render :erb, :home, layout: :default
end
ambethoney commented 9 years ago

Once a user signs into the dashboard using LinkedIn, I have links to pull in information from Dribbble and GitHub

vanderhoop commented 9 years ago

Hey Angelina, Looks like you're redirecting to /home after you authenticate with dribble, and your route handler for /home calls the get_contacts method, which will only work if the user is signed in via LinkedIn. Maybe only called that method conditionally?

ambethoney commented 9 years ago

Okay, thanks! I'll try that.