]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/plugins/oauth-plugin/generators/oauth_provider/templates/oauth_nonce.rb
Switch to using oauth-plugin as a gem
[rails.git] / vendor / plugins / oauth-plugin / generators / oauth_provider / templates / oauth_nonce.rb
diff --git a/vendor/plugins/oauth-plugin/generators/oauth_provider/templates/oauth_nonce.rb b/vendor/plugins/oauth-plugin/generators/oauth_provider/templates/oauth_nonce.rb
deleted file mode 100644 (file)
index 075351b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Simple store of nonces. The OAuth Spec requires that any given pair of nonce and timestamps are unique.
-# Thus you can use the same nonce with a different timestamp and viceversa.
-class OauthNonce < ActiveRecord::Base
-  validates_presence_of :nonce, :timestamp
-  validates_uniqueness_of :nonce, :scope => :timestamp
-  
-  # Remembers a nonce and it's associated timestamp. It returns false if it has already been used
-  def self.remember(nonce, timestamp)
-    oauth_nonce = OauthNonce.create(:nonce => nonce, :timestamp => timestamp)
-    return false if oauth_nonce.new_record?
-    oauth_nonce
-  end
-end