1 class Oauth2Token < AccessToken
4 def as_json(_options = {})
5 d = { :access_token => token, :token_type => "bearer" }
6 d[:expires_in] = expires_in if expires_at
11 q = "access_token=#{token}&token_type=bearer"
12 q << "&state=#{CGI.escape(state)}" if @state
13 q << "&expires_in=#{expires_in}" if expires_at
14 q << "&scope=#{CGI.escape(scope)}" if scope
19 expires_at.to_i - Time.now.to_i