{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2020-05-30T05:47:26Z","object_id":{"id":1293,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_auth2fa","title":"mod_auth2fa","uri":"https:\/\/zotonic.com\/id\/1293"},"seq":1000000}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"subject":{"objects":[{"created":"2026-09-09T13:48:09Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:48:09Z","object_id":{"id":2562,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_site_administrator","title":"Site administrator","uri":"https:\/\/zotonic.com\/id\/2562"},"seq":2},{"created":"2026-09-09T13:48:09Z","object_id":{"id":2591,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_two_factor_authentication","title":"Two-factor authentication","uri":"https:\/\/zotonic.com\/id\/2591"},"seq":3},{"created":"2026-09-09T13:48:09Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":4},{"created":"2026-09-09T13:48:09Z","object_id":{"id":2652,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_authenticate","title":"Authenticate","uri":"https:\/\/zotonic.com\/id\/2652"},"seq":5}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":1569,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1569"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_model_model_auth2fa","page_url":{"en":"https:\/\/zotonic.com\/docs\/1569\/auth2fa","x-default":"https:\/\/zotonic.com\/docs\/1569\/auth2fa"},"preview_url":null,"resource":{"version":3320,"pivot_location_lat":null,"title":"auth2fa","is_authoritative":true,"body":"<p>Model for two-factor authentication state and setup, including TOTP QR\/image generation, mode checks, reset checks, and clock skew checks.<\/p>\n<h2>Available Model API Paths<\/h2>\n<table class=\"table\"><thead><tr><th>Method<\/th><th>Path pattern<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>get<\/code><\/td><td><code>\/new_totp_image_url<\/code><\/td><td>Return the TOTP provisioning QR\/image URL generated for the current authenticated user. No further lookups.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/new_totp_image_url\/+currentcode<\/code><\/td><td>Return the TOTP provisioning QR\/image URL while validating against <code>+currentcode<\/code> from the setup flow. No further lookups.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/+user\/is_totp_enabled\/...<\/code><\/td><td>Return whether user <code>+user<\/code> has a stored TOTP identity (<code>totp<\/code> identity record exists).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/is_totp_enabled\/...<\/code><\/td><td>Return whether the current authenticated user has TOTP enabled.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/is_totp_requested\/...<\/code><\/td><td>Return whether this session already requested\/shown the TOTP challenge dialog.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/+user\/is_allowed_reset\/...<\/code><\/td><td>Return whether the current user may reset 2FA for user <code>+user<\/code> (self or admin-identity edit rights).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/mode\/...<\/code><\/td><td>Return site-wide 2FA mode from <code>mod_auth2fa.mode<\/code> (<code>0=optional<\/code>, <code>1=ask<\/code>, <code>2=required<\/code>, <code>3=forced<\/code>).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/user_mode\/...<\/code><\/td><td>Return effective 2FA mode for the current user (site mode combined with ACL user-group <code>acl_2fa<\/code> settings).<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/session_mode\/...<\/code><\/td><td>Return effective 2FA mode for the current session; only username\/password and autologon-cookie sessions enforce user mode.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/clock_check<\/code><\/td><td>Return clock skew report for payload timestamp (<code>delta<\/code>, <code>delta_abs<\/code>, <code>delta_acceptable<\/code>, <code>is_ok<\/code>). No further lookups.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/clock_check\/+timestamp\/...<\/code><\/td><td>Return clock skew report for explicit <code>+timestamp<\/code> (<code>delta<\/code>, <code>delta_abs<\/code>, <code>delta_acceptable<\/code>, <code>is_ok<\/code>).<\/td><\/tr><\/tbody><\/table>\n<p><code>\/+name<\/code> marks a variable path segment. A trailing <code>\/...<\/code> means extra path segments are accepted for further lookups.<\/p>","slug":"auth2fa","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"536eae6ce6db580225cfa397d827978db9a45e7e21247f1d517d9ec578b2fbaf","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":"apps\/zotonic_mod_auth2fa\/src\/models\/m_auth2fa.erl","publication_start":"2023-01-30T19:23:59Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_auth2fa\/src\/models\/m_auth2fa.erl","pivot_location_lng":null,"doc_source_kind":"model","name":"doc_model_model_auth2fa","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:26Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_auth2fa","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"b8c4b2ccdc223257f311968fbd17b2d66f0c4156\n","erlang_module":"m_auth2fa","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-09-30T09:39:52Z","title_slug":"auth2fa"},"uri":"https:\/\/zotonic.com\/id\/1569","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1569"}},"status":"ok"}