Closed peaceful-james closed 4 years ago
There is no correct way to design a system. Phoenix contexts used credentials for its own reasons and also for teaching purposes, but it is just one possibility, not a recommendation. Other libraries like Pow use different approaches.
Thanks for the quick feedback! If Jose says it's OK both ways, I feel better. :+1:
Haha. :) I did consider having a credential like approach too - but it is a lot more complexity that may not be necessary in many cases. I also think it is probably better to have one e-mail being your primary email (therefore in the users table) and the others can be in a separate table and used for secondary purposes.
When I use this generator, I get a
User
model in anAccounts
context, with an email field on it. In the hexdocs for Contexts (https://hexdocs.pm/phoenix/contexts.html), it is recommended to putemail
on a separateCredential
schema. I am wondering - is there a good reason not to use theCredential
approach? Thanks for any feedback.