Closed Ocramius closed 11 years ago
To be noted that I'd probably prefer the password reset repository to handle the password reset instantiation, which reduces coupling, complexity and also assumes that there can always be a password request for an existing user.
While this moves some instantiation logic to the repository, I think it is a valid use case, since it abstracts the idea "for an existing email, I can always retrieve a password reset token"
@DASPRiD applied required CS fixes - mergeable IMO
@DASPRiD sad green merge button is sad :(
As discussed on IRC, it makes no sense to directly store the email address of a user in a password reset request. Instead, it makes sense to have a user object being reference, and therefore the password requests being cascade-deleted.
This PR fixes that by introducing the user repository interface, a user repository implementation via composition and modifying the password repository implementation.