Feature: Record every security event with its request 

Description 

The security log now records successful and failed logins (password, second factor, single sign-on, token), throttled attempts, logouts, ended sessions, password changes and resets (requested, completed, sent by staff), forced changes, second-factor enrolment and resets, e-mail codes, blocks and their lifting, role grants and withdrawals, personal access tokens and changes of the security settings. Each event carries its company and user where known, the entered identifier of a failure, the IP address and user agent of the request, the outcome and details without secrets. Failures are written even when the request is refused.

Impact 

The table security_log gains the columns company_id, user_agent, outcome and details. Event types now follow one vocabulary: login.locked.* is loginThrottled with the scope in its details, twoFactor.reset is twoFactorReset, passwordReset.sentByStaff is passwordResetSentByStaff; rows written before keep their old names.