Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFA email notification prevents MFA verification code in WebUI #911

Open
S0urceror opened this issue Jul 13, 2024 · 1 comment
Open

MFA email notification prevents MFA verification code in WebUI #911

S0urceror opened this issue Jul 13, 2024 · 1 comment
Labels

Comments

@S0urceror
Copy link

Overview

When smtp_username is specified the MFA dialogue in the WebUI only asks for password but never for verification code. When you delete the smtp_username it does work.

Steps to Reproduce

  1. set smtp_username, password, host and port
  2. set mfa-provider to webui
  3. restart docker container

Expected Behavior

First ask for a password. Then ask for the verification code.

Actual Behavior

Only asks for a password and never asks for the verification.

Context

The code contains:

        if icloud.requires_2fa:
            **if raise_error_on_2sa:
                raise TwoStepAuthRequiredError("Two-factor authentication is required")**
            logger.info("Two-factor authentication is required (2fa)")
            if mfa_provider == MFAProvider.WEBUI:
                request_2fa_web(icloud, logger, status_exchange)
            else:
                request_2fa(icloud, logger)

        elif icloud.requires_2sa:
            if raise_error_on_2sa:
                raise TwoStepAuthRequiredError("Two-step authentication is required")
            logger.info("Two-step authentication is required (2sa)")
            request_2sa(icloud, logger)

I believe that you should not raise the 2SA error on 2FA request. And raising an exception prevents from running request_2fa_web.

@S0urceror S0urceror added the bug label Jul 13, 2024
@holomekc
Copy link
Contributor

See #898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants