Method: FbGraph::Auth#from_cookie
- Defined in:
- lib/fb_graph/auth.rb
#from_cookie(cookie) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fb_graph/auth.rb', line 31 def () #this creates a cookie = FbGraph::Auth::Cookie.parse(self.client, ) #the cookie expires time is the time as an integer #in the oauth2 api, it does Time.now + expires, creating a time too large #instead, make expires a delta value time_expires = [:expires].to_i - Time.now.to_i self.access_token = OAuth2::AccessToken.new( self.client, [:access_token], [:refresh_token], time_expires ) self.user = FbGraph::User.new([:uid], :access_token => self.access_token) self end |