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

#13 Setup the auth command #14

Merged
merged 7 commits into from
May 17, 2024
Merged

Conversation

harrisonhowardax
Copy link
Collaborator

New Packages

  • plex_pin_auth
    • Adds the necessary tooling for creating a PIN and getting the token
  • repeatedly
    • Handles polling the Plex API to determine when the user has entered their pin
  • gleam_erlang
    • Used to add the sleep method (pauses the terminal for X milliseconds)

Additions

  • client_identifier
    • Exposes a generate method that generates a client identifier for the Plex API. Currently joins the user's saved hostname and username. This method has a dependency on the base config being valid before use.

Changes

  • terminal
    • Added a new public method for sleeping the process
  • env
    • Fixes issues where an empty string was counting as a 'valid' base or auth config when it is not
    • Added subtle fix that forces username to be required (not fully solved as of yet)
  • auth
    • Adds the functionality for asking the user to authenticate to the Plex API
    • Will prompt the user if they want to replace their auth token if they have one saved already
    • Provides the code to the user along with a link to the QR code if they want to scan it with their phone
    • Set up to poll the Plex API until the user links their account. This expires after 15 minutes, if the PIN expires the user must execute the command again

@harrisonhowardax harrisonhowardax added the enhancement New feature or request label May 4, 2024
src/commands/auth.gleam Outdated Show resolved Hide resolved
src/commands/auth.gleam Outdated Show resolved Hide resolved
src/commands/auth.gleam Outdated Show resolved Hide resolved
src/commands/auth.gleam Show resolved Hide resolved
harrisonhoward
harrisonhoward previously approved these changes May 17, 2024
@harrisonhoward harrisonhoward merged commit c156cd7 into master May 17, 2024
1 check passed
@harrisonhoward harrisonhoward deleted the feature/#13--setup-auth-command branch May 17, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants