Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dribbble API OAuth Not Directing #6

Open
ambethoney opened this issue Jan 17, 2015 · 7 comments
Open

Dribbble API OAuth Not Directing #6

ambethoney opened this issue Jan 17, 2015 · 7 comments

Comments

@ambethoney
Copy link
Owner

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
Copy link

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

@ambethoney
Copy link
Owner Author

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 #6 (comment).

@phlco
Copy link

phlco commented Jan 19, 2015

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

@ambethoney
Copy link
Owner Author


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
Copy link
Owner Author

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

@vanderhoop
Copy link

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
Copy link
Owner Author

Okay, thanks! I'll try that.

@phlco phlco removed their assignment Apr 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants