pub async fn get_2fa_status(
auth: AuthenticatedUser,
use_cases: Data<Arc<TwoFactorUseCases>>,
) -> HttpResponseExpand description
Get 2FA status for the authenticated user
Returns the current 2FA configuration status, including:
- Whether 2FA is enabled
- Number of backup codes remaining
- Whether backup codes are low (< 3)
- Whether reverification is needed (not used in 90 days)
§Security
- User must be authenticated
- Only returns user’s own 2FA status
§Returns
- 200 OK: Status retrieved successfully
- 401 Unauthorized: Not authenticated
- 500 Internal Server Error: Failed to retrieve status
§Example Response
{
"is_enabled": true,
"verified_at": "2024-11-01T10:00:00Z",
"last_used_at": "2024-12-01T08:30:00Z",
"backup_codes_remaining": 7,
"backup_codes_low": false,
"needs_reverification": false
}