Skip to content

Architecture

Internal flow when a user logs in:

  1. LoginListener catches Symfony's LoginSuccessEvent
  2. Builds a LoginParameterDto from the request (IP, user agent) and the user (UserIdentity: identifier + class)
  3. Dispatches to LoginService (sync) or AuthLoginMessage (async via Messenger)
  4. LoginService fetches geolocation data via FetchUserInformation
  5. DoctrineAuthenticationLogHandler checks if the context is known for that identity (findExistingLog), and if not, creates and saves the log (createLog + save)
  6. Dispatches AuthenticationLogEvents::NEW_DEVICE with the persisted log
  7. Sends a NewDeviceNotification (user reference, user information, log, confirmation links) via NotificationInterface

Extension points

InterfaceResponsibilityPage
AuthLogUserInterfaceexpose the email and display name of the userUser entity
AuthenticationLogRepositoryInterfacedecide whether a context is known, and persist logsRepository
AuthenticationLogCreatorInterfacebuild the log entityRepository
ConfirmableAuthenticationLogRepositoryInterfacelook a log up by its confirmation tokenLogin confirmation
RevocableAuthenticationLogRepositoryInterfacerevoke a user's known contexts on disavowalDisavowal reactions
SessionInvalidatorInterfacelog the user out everywhere on disavowalDisavowal reactions
PasswordResetRequesterInterfacetrigger the password-reset flow on disavowalDisavowal reactions
DisavowalReactionInterfaceadd a custom reaction to a disavowed loginDisavowal reactions
NotificationInterfacedeliver the alertCustom notification
AuthenticationLogHandlerInterfacereplace the whole persistence stepadvanced

Built and maintained by Spiriit — released under the MIT License.