Revert "Switch to using oauth-plugin as a gem"
This reverts commit 41a123334b
.
This commit is contained in:
parent
fa11baf5c3
commit
406b46e49b
50 changed files with 2521 additions and 28 deletions
|
@ -6,16 +6,6 @@ class ClientApplication < ActiveRecord::Base
|
|||
validates_uniqueness_of :key
|
||||
before_validation_on_create :generate_keys
|
||||
|
||||
def self.find_token(token_key)
|
||||
token = OauthToken.find_by_token(token_key, :include => :client_application)
|
||||
if token && token.authorized?
|
||||
logger.info "Loaded #{token.token} which was authorized by (user_id=#{token.user_id}) on the #{token.authorized_at}"
|
||||
token
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def self.verify_request(request, options = {}, &block)
|
||||
begin
|
||||
signature = OAuth::Signature.build(request, options, &block)
|
||||
|
|
|
@ -5,6 +5,16 @@ class OauthToken < ActiveRecord::Base
|
|||
validates_presence_of :client_application, :token, :secret
|
||||
before_validation_on_create :generate_keys
|
||||
|
||||
def self.find_token(token_key)
|
||||
token = OauthToken.find_by_token(token_key, :include => :client_application)
|
||||
if token && token.authorized?
|
||||
logger.info "Loaded #{token.token} which was authorized by (user_id=#{token.user_id}) on the #{token.authorized_at}"
|
||||
token
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def invalidated?
|
||||
invalidated_at != nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue