lib/rack/oauth2/models/auth_request.rb in rack-oauth2-server-1.2.1 vs lib/rack/oauth2/models/auth_request.rb in rack-oauth2-server-1.2.2
- old
+ new
@@ -15,10 +15,10 @@
# Create a new authorization request. This holds state, so in addition
# to client ID and scope, we need to know the URL to redirect back to
# and any state value to pass back in that redirect.
def create(client_id, scope, redirect_uri, response_type, state)
- fields = { :client_id=>client_id, :scope=>scope, :redirect_uri=>redirect_uri, :state=>state,
+ fields = { :client_id=>BSON::ObjectId(client_id.to_s), :scope=>scope, :redirect_uri=>redirect_uri, :state=>state,
:response_type=>response_type, :created_at=>Time.now.utc, :grant_code=>nil, :authorized_at=>nil, :revoked=>nil }
fields[:_id] = collection.insert(fields)
Server.new_instance self, fields
end