dotkernel / api

DotKernel's PSR-7 REST style API built around the Mezzio API skeleton.
https://docs.dotkernel.org/api-documentation/
MIT License
35 stars 5 forks source link

User email vs identity #39

Closed bidi47 closed 3 years ago

bidi47 commented 3 years ago

the User entity has no email property or getters/setters for it but UserService still uses getEmail and setEmail

we need to discuss again how to handle identity the user should have an email to be contacted, but identity can be a non-email string which would break e.g. the welcome email

arhimede commented 3 years ago

Important: update User if will update the email in user_detail table , should it update the identity in user table ?

arhimede commented 3 years ago

TABLE user.identity
TABLE user_detail email Nullabel, used for recover password

user.identity == user_detail.email ? NO

DEFAULT user.identity != user_detail.email

EXAMPLE : mario@dotkernel.com identity NEVER CHANGE ( only manually in DB )

** UPDATE User _details email updates ONLY user_detail.email

RESET PASSWORD ? user_detail.email FORM 1. recover identity EMAIL => identity sent by mail IF EXISTS FORM 2. reset passwodr: IDENTITY => password reset link sent by email

CREATE ACCOUNT : email, password , first , lastname

INSERT user.identity && user.password INSERT user_detail firts, last, email

arhimede commented 3 years ago

Must be implemented in frontend too