Concorda / concorda-server

MIT License
8 stars 2 forks source link

investigate seneca-user's usage of 'nick' as a primary key of sorts. #65

Open AdrianRossouw opened 8 years ago

AdrianRossouw commented 8 years ago

I recall seeing some stuff in seneca-user before that led me to believe that it wasn't using the dynamically generated id to the level it should be.

mirceaalexandru commented 8 years ago

@AdrianRossouw:

In seneca-user there are three fields used - nick, username and email. One of them should be provided.

When user is registered the nick is:

https://github.com/senecajs/seneca-user/blob/master/user.js#L518

Nick should be unique in the user collection, and this is verified at app level:

https://github.com/senecajs/seneca-user/blob/master/user.js#L531

The id of the user is generated dynamically, according with the store used by the application.

Regarding your discussion, if nick is provided, it will be used (in this case nick and email cand be different), if not then nick will be equal with username (if provided) or with email.