LouisaBarrett / runline-2

0 stars 2 forks source link

MapMyFitness Callback Issue? #27

Closed breethomas closed 10 years ago

breethomas commented 10 years ago

@jayzes @mikepack @LouisaBarrett

Jay/Mike. Not sure what we messed up...but we can't get past the MMF auth page. Something goofy in the callback I think.... Here is detailed list of what's happening:

 def initialize_http_header(initheader)
    @header = {}
    return unless initheader
    initheader.each do |key, value|
      warn "net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE
      @header[key.downcase] = [value.strip]
    end
  end
jayzes commented 10 years ago

Interesting. Was it broken locally or when you deployed?

unrealities commented 10 years ago

I was getting this issue locally when I was just hacking around omniauth.rb and put my api_key and api_secret directly in the initializer instead of using environment variables. When I updated my .bash_profile to export ENV['MMF_API_KEY'] and ENV['MMF_API_SECRET'] I was able to get the callback to complete successfully.

I noticed this note in the omniauth-mapmyfitness-oauth2 readme that got me going:

NOTE: The ENV['MMF_API_KEY'] is unsed in an unusual place in this strategy. It must be defined for the library to work.

Hopefully this is just how you're setting your environment variables locally or when you deploy.

LouisaBarrett commented 10 years ago

@unrealities Hi Tom!

We are using the gem dotenv-rails for exporting the key/secret, however, we inadvertently moved that gem lower in the gem file, below the omniauth-mapmyfitness-oauth2 gem, so it was breaking. Whoops!

Thanks for all your feedback, we were excited to hear your thoughts! :) -L

unrealities commented 10 years ago

@LouisaBarrett makes sense. Glad you got it figured out!