Continues the extraction begun with Accounts.TOTP and Accounts.Sessions.
The context module shrinks from ~1198 to 577 lines by moving cohesive
sub-domains into dedicated submodules under lib/towerops/accounts/:
* Consents - grant/revoke/list user consents (+ private
grant_consents_sequential helper used by
register_user/1)
* PolicyVersions - policy version CRUD + reconsent detection
* LoginHistory - record/list/count login attempts, GDPR anonymize
* MagicLinks - magic-link login flow
* Passwords - change/update/reset + reset-instruction email
* Emails - change/update + update-instruction email
The Accounts module retains a defdelegate facade so existing callers
across lib/towerops_web and other contexts continue to work unchanged.
Two shared transaction helpers (update_user_and_delete_all_tokens/1 and
unwrap_transaction_result/1) are used by multiple extracted modules; they
remain in Accounts but are now public with @doc false rather than
duplicated.
|
||
|---|---|---|
| .. | ||
| browser_session.ex | ||
| consents.ex | ||
| emails.ex | ||
| hibp.ex | ||
| login_attempt.ex | ||
| login_history.ex | ||
| magic_links.ex | ||
| passwords.ex | ||
| policy_version.ex | ||
| policy_versions.ex | ||
| scope.ex | ||
| sessions.ex | ||
| totp.ex | ||
| user.ex | ||
| user_agent_parser.ex | ||
| user_consent.ex | ||
| user_notifier.ex | ||
| user_recovery_code.ex | ||
| user_token.ex | ||
| user_totp_device.ex | ||