You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may be wrong, but I believe this accounts implementation allows for multiple accounts to claim the same email/username by first creating accounts separately, then changing the emails/usernames of the different accounts to be the same. This is an issue I've faced in my own work, and found I had to solve it via a separate aggregate + a process manager.
My solution uses a map aggregate where each instance is a different map. All account emails are tracked in an account_emails map aggregate instance where the keys are emails, and values are account ids. The process manager starts in response to an account email change requested event, then reserves the email it plans to use in the account_emails map aggregate instance, then updates the account in the account aggregate, then releases the old email in the account_emails map aggregate instance. If the account aggregate update fails, it releases the new email in the account_emails map aggregate instance then fails.
Do you have a simpler solution?
The text was updated successfully, but these errors were encountered:
I may be wrong, but I believe this accounts implementation allows for multiple accounts to claim the same email/username by first creating accounts separately, then changing the emails/usernames of the different accounts to be the same. This is an issue I've faced in my own work, and found I had to solve it via a separate aggregate + a process manager.
My solution uses a map aggregate where each instance is a different map. All account emails are tracked in an account_emails map aggregate instance where the keys are emails, and values are account ids. The process manager starts in response to an account email change requested event, then reserves the email it plans to use in the account_emails map aggregate instance, then updates the account in the account aggregate, then releases the old email in the account_emails map aggregate instance. If the account aggregate update fails, it releases the new email in the account_emails map aggregate instance then fails.
Do you have a simpler solution?
The text was updated successfully, but these errors were encountered: