Sha256: 70655b3d6cee5fd0334695a894276308499f93ff013306d05fd8f0b9968a3a5a

Contents?: true

Size: 456 Bytes

Versions: 10

Compression:

Stored size: 456 Bytes

Contents

class Oauth2Verifier < OauthToken
  validates_presence_of :user

  def exchange!(params={})
    Oauth2Token.create!(:user => user, :client_application => client_application).tap do
      invalidate!
    end
  end

  def code
    token
  end

  def redirect_url
    callback_url
  end

  protected

  def generate_keys
    self.token = OAuth::Helper.generate_key(20)[0,20]
    self.valid_to = 10.minutes.from_now
    self.authorized_at = Time.now
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
oauth-plugin-0.4.0.pre7 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
oauth-plugin-0.4.0.pre6 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
oauth-plugin-0.4.0.pre5 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
insrc-oauth-plugin-0.4.0.pre6 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
insrc-oauth-plugin-0.4.0.pre5 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
le1t0-oauth-plugin-0.4.0.pre4.001 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
oauth-plugin-0.4.0.pre4 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
oauth-plugin-0.4.0.pre3 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
oauth-plugin-0.4.0.pre2 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb
oauth-plugin-0.4.0.pre1 lib/generators/mongoid/oauth_provider_templates/oauth2_verifier.rb