CleverStack / clever-auth

CleverStack Authentication Module
cleverstack.io
MIT License
18 stars 4 forks source link

ODM Support #3

Closed pilsy closed 10 years ago

pilsy commented 10 years ago
pilsy commented 10 years ago

As per #2

mrsollis commented 10 years ago

@pilsy since this was closed, is this available? I still can not see documentation on how this would be configured. Thank you for your work on this.

pilsy commented 10 years ago

@mrsollis Yes sorry i have not had a chance to update the documentation, i will be updating it today however...

Essentially all Models in CleverStack are now first class citizens, meaning when you write a model it can either work on ODM or ODM - you don't need to change any of the actual fields or definition... and you can also simply use native types

{ name: String, email: String, someNumber: Number, someDate: Date // ... etc }

To make the auth module use ODM, The only change you need to make is on https://github.com/CleverStack/clever-auth/blob/master/models/UserModel.js#L2

Change, ORM - to ODM.

Of course you will need to clever install clever-odm and configure it to work with your mongo installation but essentially all you need to do is change that one "ORM" to "ODM" and you are away.

pilsy commented 10 years ago

And i should point out that today i plan to move that one line into the config @mrsollis

pilsy commented 10 years ago

@mrsollis take a look at this commit, in the description it shows you how to choose ORM or ODM in your config

https://github.com/CleverStack/clever-auth/commit/954d2bf7cfa5d1e00a7d6cd6da04439e34666f08