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

Fix Plex login for users with 2FA enabled #1585

Merged
merged 4 commits into from
Sep 14, 2023
Merged

Fix Plex login for users with 2FA enabled #1585

merged 4 commits into from
Sep 14, 2023

Conversation

ericswpark
Copy link
Contributor

@ericswpark ericswpark commented Sep 14, 2023

This should fix login for Plex users using 2FA.

Closes #1584

TODO:

  • Test that it works
  • Test that commit doesn't break login for non-2FA users

This was causing 2FA to not work as it was being paired with the
`remember` argument. To avoid issues like these in the future,
explicitly pair each parameter to each argument.
@ericswpark
Copy link
Contributor Author

Fixed a bug with the initial commit where the arguments were being passed to the wrong parameter^ (Blame me for being confused with Swiftlang and thinking Python did named parameter matching)

I've tested it and it works for both 2FA and non-2FA users!

@glensc
Copy link
Collaborator

glensc commented Sep 14, 2023

So empty code is probably "", not None, that's fine too?

code = Prompt.ask(PROMPT_PLEX_CODE)
return MyPlexAccount(username=username, password=password, code=code)

@ericswpark
Copy link
Contributor Author

@glensc I'm not sure what Prompt returns if the user leaves it empty, but I've confirmed that it works by creating a dummy account without 2FA. Either the plexapi library leaves it out intelligently, or the Plex API ignores the value if 2FA is not set up.

@simonc56
Copy link
Collaborator

Readme file should be updated too (remove line about code appended to password).

@ericswpark
Copy link
Contributor Author

@twolaw done, just updated it :) Please let me know if there are other references that I may have missed.

@simonc56
Copy link
Collaborator

Remove comment import on line 17.

@glensc glensc merged commit e671d44 into Taxel:main Sep 14, 2023
@ericswpark ericswpark deleted the 2fa-fix branch September 14, 2023 23:35
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.

PlexTraktSync is broken for Plex 2FA users
3 participants