Skip to content

Token Details response fails validation #25

Description

@FoxxMD

All of the other endpoints i've tried have worked fine but authentication.getTokenDetails() errors with an error about failed validation:

SDKValidationError: Response validation failed: [
  {
    "received": 1,
    "code": "invalid_enum_value",
    "options": [
      "0",
      "1"
    ],
    "path": [
      "UserPlexAccount",
      "profile",
      "autoSelectSubtitle"
    ],
    "message": "Invalid enum value. Expected '0' | '1', received '1'"
  },
  {
    "received": 0,
    "code": "invalid_enum_value",
    "options": [
      "0",
      "1"
    ],
    "path": [
      "UserPlexAccount",
      "profile",
      "defaultSubtitleAccessibility"
    ],
    "message": "Invalid enum value. Expected '0' | '1', received '0'"
  },
  {
    "received": 1,
    "code": "invalid_enum_value",
    "options": [
      "0",
      "1"
    ],
    "path": [
      "UserPlexAccount",
      "profile",
      "defaultSubtitleForced"
    ],
    "message": "Invalid enum value. Expected '0' | '1', received '1'"
  },
  {
    "received": 1,
    "code": "invalid_enum_value",
    "options": [
      "0",
      "1"
    ],
    "path": [
      "UserPlexAccount",
      "profile",
      "watchedIndicator"
    ],
    "message": "Invalid enum value. Expected '0' | '1', received '1'"
  },
  {
    "received": "artist-tv",
    "code": "invalid_enum_value",
    "options": [
      "Android - Dolby Vision",
      "Android - PiP",
      "CU Sunset",
...
    "message": "Invalid enum value. Expected 'Android - Dolby Vision' | 'Android - PiP' | 'CU Sunset' | 'HRK_enable_EUR' | 'TREBLE-show-features' | 'ad-countdown-timer' | 'adaptive_bitrate' | 'amazon-loop-debug' | 'avod-ad-analysis' | 'avod-new-media' | 'blacklist_get_signin' | 'client-radio-stations' | 'cloudflare-turnstile-required' | 'collections' | 'comments_and_replies_push_notifications' | 'community_access_plex_tv' | 'companions_sonos' | 'custom-home-removal' | 'disable_home_user_friendships' | 'disable_sharing_friendships' | 'drm_support' | 'exclude restrictions' | 'federated-auth' | 'friend_request_push_notifications' | 'guided-upgrade' | 'home' | 'increase-password-complexity' | 'ios14-privacy-banner' | 'iterable-notification-tokens' | 'keep-payment-method' | 'kevin-bacon' | 'korea-consent' | 'le_isrg_root_x1' | 'lets_encrypt' | 'lightning-dvr-pivot' | 'live-tv-support-incomplete-segments' | 'livetv' | 'metadata_search' | 'new_plex_pass_prices' | 'news-provider-sunset-modal' | 'photos-favorites' | 'photos-metadata-edition' | 'pms_health' | 'radio' | 'rate-limit-client-token' | 'scrobbling-service-plex-tv' | 'shared_server_notification' | 'shared_source_notification' | 'signin_with_apple' | 'spring_serve_ad_provider' | 'transcoder_cache' | 'tuner-sharing' | 'two-factor-authentication' | 'unsupportedtuners' | 'upgrade-3ds2' | 'vod-schema' | 'vod_cloudflare' | 'watch-together-invite' | 'web_server_dashboard', received 'web-log-viewer'"
  },
  {
    "received": "web-share-v2",
    "code": "invalid_enum_value",
    "options": [
      "Android - Dolby Vision",
      "Android - PiP",
      "CU Sunset",
      "HRK_enable_EUR",
      "TREBLE-show-features",
....
      "vod_cloudflare",
      "watch-together-invite",
      "web_server_dashboard"
    ],
    "path": [
      "UserPlexAccount",
      "subscription",
      "features",
      167
    ],
    "message": "Invalid enum value. Expected 'Android - Dolby Vision' | 'Android - PiP' | 'CU Sunset' | 'HRK_enable_EUR' | 'TREBLE-show-features' | 'ad-countdown-timer' | 'adaptive_bitrate' | 'amazon-loop-debug' | 'avod-ad-analysis' | 'avod-new-media' | 'blacklist_get_signin' | 'client-radio-stations' | 'cloudflare-turnstile-required'
...
hboard', received 'where-to-watch-clients'"
  },
  {
    "code": "invalid_type",
    "expected": "array",
    "received": "undefined",
    "path": [
      "UserPlexAccount",
      "subscriptions"
    ],
    "message": "Required"
  }
]
    at get error [as error] (CWD/node_modules/zod/lib/types.js:55:31)
    at ZodEffects.parse (CWD/node_modules/zod/lib/types.js:160:22)
    at <anonymous> (CWD/node_modules/@lukehagar/plexjs/src/lib/matchers.ts:274:42)
    at safeParse (CWD/node_modules/@lukehagar/plexjs/src/lib/schemas.ts:47:15)
    at matchFunc (CWD/node_modules/@lukehagar/plexjs/src/lib/matchers.ts:272:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at authenticationGetTokenDetails (CWD/node_modules/@lukehagar/plexjs/src/funcs/authenticationGetTokenDetails.ts:98:21)
    at unwrapAsync (CWD/node_modules/@lukehagar/plexjs/src/sdk/types/fp.ts:44:13)
    at PlexApiSource.doAuthentication (CWD/src/backend/sources/PlexApiSource.ts:132:29)
    at PlexApiSource.testAuth (CWD/src/backend/common/AbstractComponent.ts:229:27)

The above occurs on plexjs 0.23.5. On the newest (unpublished) version 0.26.1 the response is instead a 404. PMS version 1.41.0.8994

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions