Summary
When an invitation contains multiple Plex servers, completing Plex OAuth only joins the user to the first Plex server attached to the invite. Additional Plex servers are skipped.
Reproduction
- Configure at least two Plex servers in Wizarr.
- Create one invite containing both Plex servers, optionally with Emby/Jellyfin servers too.
- Open the invite as a user.
- Click Join Server and complete Plex OAuth.
- Wizarr processes the invite and redirects to the next step.
- Only the first Plex server is marked used / joined. The second Plex server is never invited.
Observed cause
handle_oauth_token() currently selects only the first Plex server from the invitation:
plex_servers = [s for s in inv.servers if s.server_type == "plex"]
server = plex_servers[0] if plex_servers else inv.servers[0]
The password step skips Plex servers, so any additional Plex servers attached to the invitation never get processed.
Relevant files:
app/services/media/plex.py
app/blueprints/public/routes.py
app/templates/user-plex-login.html
Expected behavior
A successful Plex OAuth should apply to every Plex server attached to the invitation, then continue to the password step for non-Plex servers if needed.
Fix direction
Loop over all Plex servers on the invitation and for each server:
- create/update the Wizarr user row for that email/server
- invite/update Plex sharing for that server
- mark that server as used for the invitation
- run post-join setup for that server
This should let a single invite add a Plex-authenticated user to multiple Plex servers while still allowing Emby/Jellyfin/etc. to continue through the password step.
Notes
I hit this while testing a mixed multi-server invite with two Plex servers and two Emby servers. A local hotfix that loops through all Plex servers in handle_oauth_token() resolved the Plex side of the flow.
Summary
When an invitation contains multiple Plex servers, completing Plex OAuth only joins the user to the first Plex server attached to the invite. Additional Plex servers are skipped.
Reproduction
Observed cause
handle_oauth_token()currently selects only the first Plex server from the invitation:The password step skips Plex servers, so any additional Plex servers attached to the invitation never get processed.
Relevant files:
app/services/media/plex.pyapp/blueprints/public/routes.pyapp/templates/user-plex-login.htmlExpected behavior
A successful Plex OAuth should apply to every Plex server attached to the invitation, then continue to the password step for non-Plex servers if needed.
Fix direction
Loop over all Plex servers on the invitation and for each server:
This should let a single invite add a Plex-authenticated user to multiple Plex servers while still allowing Emby/Jellyfin/etc. to continue through the password step.
Notes
I hit this while testing a mixed multi-server invite with two Plex servers and two Emby servers. A local hotfix that loops through all Plex servers in
handle_oauth_token()resolved the Plex side of the flow.