plataformatec/devise — pull request #2882 by hauleth (2014-02-23 20:20:10+00:00)
Title: Devise + Mongoid store wrong data in session

I'm using Devise 3.2.3 + Mongoid 4.0.0.beta1 and when I try to call `current_user` I get:

~~~
The operation: #{"_id"=>{"$oid"=>BSON::ObjectId('530a1ec84e49550fbd000000')}}, "$orderby"=>{:_id=>1}}
@fields=nil>
failed with error 10068: "invalid operator: $oid"

See https://github.com/mongodb/mongo/blob/master/docs/errors.md
for details about this error.
~~~

Bug is somewhere where this is set:

warden.user.user.key: [[{"$oid"=>BSON::ObjectId('530a1ec84e49550fbd000000')}], "$2a$10$/J1DMorvMdGZm6aQicsYL."]