I am trying intergrate Koala into a devise omniauth-facebook app. For some reason i cannot post to user's wall. I created a second app which doesn't use devise and all works and i realise that the only difference is that oauth_expires_at I am having problems saving the oauth_expires_at returned by facebook.
# Facebook
def self.find_for_facebook_oauth(auth, signed_in_resource=nil)
user = User.where(:provider => auth.provider, :uid => auth.uid).first
unless user
user = User.create( name:auth.extra.raw_info.name,
provider:auth.provider,
uid:auth.uid,
email:auth.info.email,
image:auth.info.image,
oauth_token:auth.credentials.token,
password:Devise.friendly_token[0,20]
)
end
user
end
I have tried
#oauth_expires_at:auth.credentials.expires_at.to_datetime,
#oauth_expires_at:auth.Time.at(auth['credentials'].expires_at),
#oauth_expires_at:Time.at(@auth[:credentials][:expires_at]).to_datetime,
How do i convert the facebook time response to PostgreSQL datetime format. Please help. Or does it matter?
Looks like oauth_expires_at
is not causing the problem after all. I stand corrected.