Skip to content

[BUG] Multi-server invite only joins first Plex server after Plex OAuth #1291

@croax

Description

@croax

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

  1. Configure at least two Plex servers in Wizarr.
  2. Create one invite containing both Plex servers, optionally with Emby/Jellyfin servers too.
  3. Open the invite as a user.
  4. Click Join Server and complete Plex OAuth.
  5. Wizarr processes the invite and redirects to the next step.
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions