sinatra-authentication
sinatra-authentication copied to clipboard
id instead of _id with dm-core
I'm using this authentication system with datamapper over mongo-db. Signup works but insert a dm-user with two id field:
- "_id" that contains the identifier of the records
- "id" which is null.
During a log in, if the user and password are correct, the user is logged in as the user nil, and is consequently staying a guest.
Edit: I fixed my particular problem by overriding the DmUsers class and replacing Serial by the type: ObjectId and by adding "require 'mongo_adapter'" which include the support for that specific mongo type