Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AdrianRossouw opened this issue May 12, 2016 · 1 comment

Comments

@AdrianRossouw
Copy link
Contributor

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
Copy link
Collaborator

mirceaalexandru commented May 13, 2016

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants