Skip to content

feat: add TOTP-based 2FA support for V2 authentication#35

Open
mark-tt wants to merge 2 commits intodev-mirzabicer:mainfrom
mark-tt:feat/2fa-totp-support
Open

feat: add TOTP-based 2FA support for V2 authentication#35
mark-tt wants to merge 2 commits intodev-mirzabicer:mainfrom
mark-tt:feat/2fa-totp-support

Conversation

@mark-tt
Copy link
Copy Markdown

@mark-tt mark-tt commented Feb 13, 2026

The SDK already had authenticate_2fa() implemented but the initialization flow didn't use it - when 2FA was required, it would catch the error and give up. This change completes the 2FA flow automatically using a TOTP secret provided via the TICKTICK_TOTP_SECRET environment variable.

Uses only stdlib modules (hmac, hashlib, struct) to generate TOTP codes per RFC 6238, so no new dependencies are needed.

Closes #27

MT and others added 2 commits February 14, 2026 00:09
The SDK already had authenticate_2fa() implemented but the initialization
flow didn't use it - when 2FA was required, it would catch the error and
give up. This change completes the 2FA flow automatically using a TOTP
secret provided via the TICKTICK_TOTP_SECRET environment variable.

Uses only stdlib modules (hmac, hashlib, struct) to generate TOTP codes
per RFC 6238, so no new dependencies are needed.

Closes dev-mirzabicer#27
The TickTick API sometimes returns "" (empty string) for the repeatFrom
field instead of an integer or null. Add a field_validator to coerce
empty strings to None, preventing Pydantic validation errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support 2FA accounts

1 participant