X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/effb1b7f4170bb7244c4dfffcbe6134fe00e2bc4..64816e50b57ced52f5fb0082f97b2844e002cf11:/app/models/oauth_nonce.rb?ds=sidebyside diff --git a/app/models/oauth_nonce.rb b/app/models/oauth_nonce.rb index 0952f068e..9d2773e8f 100644 --- a/app/models/oauth_nonce.rb +++ b/app/models/oauth_nonce.rb @@ -22,8 +22,10 @@ class OauthNonce < ActiveRecord::Base # Remembers a nonce and it's associated timestamp. It returns false if it has already been used def self.remember(nonce, timestamp) return false if Time.now.to_i - timestamp.to_i > 86400 + oauth_nonce = OauthNonce.create(:nonce => nonce, :timestamp => timestamp.to_i) return false if oauth_nonce.new_record? + oauth_nonce end end