lib/rack/oauth2/models/client.rb in rack-oauth2-server-2.0.0.beta4 vs lib/rack/oauth2/models/client.rb in rack-oauth2-server-2.0.0.beta5
- old
+ new
@@ -28,11 +28,11 @@
redirect_uri = Server::Utils.parse_redirect_uri(args[:redirect_uri]).to_s if args[:redirect_uri]
scope = Server::Utils.normalize_scope(args[:scope])
fields = { :display_name=>args[:display_name], :link=>args[:link],
:image_url=>args[:image_url], :redirect_uri=>redirect_uri,
:nodes=>args[:notes].to_s, :scope=>scope,
- :created_at=>Time.now.utc.to_i, :revoked=>nil }
+ :created_at=>Time.now.to_i, :revoked=>nil }
if args[:id] && args[:secret]
fields[:_id], fields[:secret] = BSON::ObjectId(args[:id].to_s), args[:secret]
collection.insert(fields, :safe=>true)
else
fields[:secret] = Server.secure_random
@@ -93,10 +93,10 @@
attr_accessor :revoked
# Revoke all authorization requests, access grants and access tokens for
# this client. Ward off the evil.
def revoke!
- self.revoked = Time.now.utc.to_i
+ self.revoked = Time.now.to_i
Client.collection.update({ :_id=>id }, { :$set=>{ :revoked=>revoked } })
AuthRequest.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })
AccessGrant.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })
AccessToken.collection.update({ :client_id=>id }, { :$set=>{ :revoked=>revoked } })
end