1 class Oauth2Verifier < OauthToken
 
   2   validates :user, :presence => true, :associated => true
 
   6   def exchange!(_params = {})
 
   7     OauthToken.transaction do
 
   8       token = Oauth2Token.create! :user => user, :client_application => client_application, :scope => scope
 
  24     q << "&state=#{URI.escape(state)}" if @state
 
  31     self.token = OAuth::Helper.generate_key(20)[0, 20]
 
  32     self.expires_at = 10.minutes.from_now
 
  33     self.authorized_at = Time.now