The login command in the PxPlus Package Manager allows you to sign in to your pxpm account. It ensures API connectivity needed for tasks such as uploading or downloading private packages.
login
When you run the login command, the following steps occur:
API Connectivity Check:
The command first verifies that the API is accessible. If the API cannot be reached, a NoApiAccessException is thrown.
Existing Session Check:
If a user is already logged in, the command displays the current user's email and asks if you want to continue and log in as a different user.
Credential Prompt:
The command interactively prompts you for your email and password.
The login command does not require any command-line parameters. Instead, it interactively requests the following inputs:
login
Success:
A message confirming a successful login is displayed along with your email address.
Failure:
If the login fails due to incorrect credentials or other issues, an error message is displayed.
NoApiAccessException:
Thrown if the API is not accessible.
Exception:
Thrown if the email or password is empty.
Other Exceptions:
Additional errors during the authentication process are caught and logged accordingly.