Skip to content

Force password login flow when OTP redirect occurs - #62

Open
FJabilee wants to merge 1 commit into
FallingLights:mainfrom
FJabilee:feat/FixLoginMethod
Open

Force password login flow when OTP redirect occurs#62
FJabilee wants to merge 1 commit into
FallingLights:mainfrom
FJabilee:feat/FixLoginMethod

Conversation

@FJabilee

Copy link
Copy Markdown

This PR introduces a "force password login" flow to handle cases where the site redirects users to the OTP (password-free) login page.

Changes included in this PR

  • Added force_sign_in_url_password():

    • Detects if the driver is on an OTP redirect URL matching /secure/{courseID}/identity/login/otp.
    • Attempts to click the “log in with a password” link if it exists (id="login-with-password-link").
    • If the link is not found, constructs the equivalent password login URL /secure/{courseID}/identity/login/password?force=true and navigates to it.
  • Updated find_login() to call force_sign_in_url_password() after navigating to the fallback /sign_in URL if the standard “Login” link is not found.

  • Added logging around OTP detection and fallback URL navigation for better visibility.

Related Issue

  • Resolves / addresses: [#56, #53]

@grubbychicken

Copy link
Copy Markdown

This is commit was just what I needed - worked perfectly. Thanks

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.

2 participants