Question

I'm trying to connect with the fitbit api. I'm trying to learn Oauth on Rails

device/controller

def create
  device = request.env["omniauth.auth"]       
  current_user.devices.find_or_create_by_provider_and_oauth_token_and_oauth_verifier(device['provider'], device['oauth_token'], device["oauth_verifier"])
  flash[:notice] = "Device Successfully connected."
  redirect_to devices_url
end

So, I make a call to fitbit with my credentials asking for a users token and verifiers. I'm receiving back the parameters:

{"oauth_token"=>"1c...d7e",

"oauth_verifier"=>"li...i5", "provider"=>"fitbit"}

and receiving the error:

ActiveRecord::DangerousAttributeError in DevicesController#create

any ideas on how to fix this? thanks

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top