April 2020
Intermediate to advanced
292 pages
6h 50m
English
Strictly speaking, we don’t need any events to handle authentication. In Chapter 6, Registering Users, we wrote a migration for View Data with emails and hashed passwords. We can just query that table and then track login status using cookies, JWTs,[53] or whatever. Authentication is also synchronous, so it doesn’t involve any Components or require commands. This is why the term “auth service” is nonsensical. Authentication is a query, and autonomous services—the component we’re building—don’t respond to queries.
That said, there may still be interesting domain events around authentication. We may want to know how often users log in or if we’re getting a lot of failed attempts. Maybe we need ...
Read now
Unlock full access