feat: add TOTP 2FA support to session token generation#42
Closed
Villoh wants to merge 3 commits into
Closed
Conversation
- Detect TOTP challenge redirect after email OTP callback - Prompt user for authenticator app code (6-digit TOTP) - POST to /api/auth/totp/challenge-verify with challenge token
- Extract _prompt_email, _fetch_csrf, _send_otp, _resolve_redirect_url - Extract _follow_callback, _verify_totp, _extract_and_present_token - run() now acts as a thin orchestrator (~25 lines) - Fixes CodeFactor 'Complex Method' flag
Owner
|
Hey @Villoh, thank you so much for this contribution! Your PR was a fantastic starting point for the TOTP implementation. Since there were some merge conflicts with recent updates to the CLI flow (PR #41), and we needed to add some extra error-handling logic (like retry loops for invalid/expired OTP and TOTP codes to prevent API crashes), I ended up refactoring the implementation in a new branch. I've opened PR #44 to merge these changes. I made sure to include you as a I'll be closing this PR in favor of #44. Thanks again for your awesome work! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for Perplexity accounts with TOTP-based two-factor authentication in the interactive session token generator.
Changes
/api/auth/totp/challenge-verifywith challenge token