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

Drop Email as User Id #903

Open
lautarodragan opened this issue Apr 10, 2019 · 3 comments
Open

Drop Email as User Id #903

lautarodragan opened this issue Apr 10, 2019 · 3 comments

Comments

@lautarodragan
Copy link
Member

Since the email address of a user can change, and there is no other attribute of the user object that remains immutable, we need to introduce a new, immutable id attribute.

In the future, once we have decentralized ids and the API functions as a proper IDP, we'll need to research further into this topic and decide whether we can use the DID as the unique and only identifier or we'd rather keep the centralized ID of each user and associate it with a DID instead.

Right now, we need a more immediate solution.

A bit of research on centralized but collision resistant identifiers needs to be done. The ObjectId generated by MongoDB may do the job just fine, though.

Once we have the new ID in place, we should add it to the API Tokens and update the authorization middleware's validation not to verify the token's email but the immutable ID instead.

@wdavidturner
Copy link

Let's not rely on the database specific ObjectId here as that would lock us in to a vendor.

@lautarodragan
Copy link
Member Author

You're right.

Maybe https://github.com/ericelliott/cuid
140k weekly downloads and up in npm

@lautarodragan
Copy link
Member Author

14m for good old https://www.npmjs.com/package/uuid

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

No branches or pull requests

2 participants