lib/rack/oauth2/models/auth_request.rb in rack-oauth2-server-2.0.1 vs lib/rack/oauth2/models/auth_request.rb in rack-oauth2-server-2.1.0
- old
+ new
@@ -9,9 +9,10 @@
class << self
# Find AuthRequest from identifier.
def find(request_id)
id = BSON::ObjectId(request_id.to_s)
Server.new_instance self, collection.find_one(id)
+ rescue BSON::InvalidObjectId
end
# 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.