Fix TOTP Code Sort (#4082)

This commit is contained in:
Marc Kelechava
2025-11-24 10:04:14 -08:00
committed by GitHub
parent a5e7b612c2
commit 46fdd2b913
2 changed files with 12 additions and 22 deletions

View File

@@ -178,22 +178,14 @@ async def get_totp_codes(
description="Maximum number of codes to return.",
),
) -> list[TOTPCode]:
if totp_identifier:
codes = await app.DATABASE.get_otp_codes(
organization_id=curr_org.organization_id,
totp_identifier=totp_identifier,
otp_type=otp_type,
workflow_run_id=workflow_run_id,
limit=limit,
)
else:
codes = await app.DATABASE.get_recent_otp_codes(
organization_id=curr_org.organization_id,
limit=limit,
valid_lifespan_minutes=None,
otp_type=otp_type,
workflow_run_id=workflow_run_id,
)
codes = await app.DATABASE.get_recent_otp_codes(
organization_id=curr_org.organization_id,
limit=limit,
valid_lifespan_minutes=None,
otp_type=otp_type,
workflow_run_id=workflow_run_id,
totp_identifier=totp_identifier,
)
return codes