pnp / pnp/cli-microsoft365

Add ability to ensure a specified connection.

Open
#6,414 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted keep-open
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Currently, when using login --ensure, the CLI ensures the active connection. However, if we use the --connectionName option, it would be better if it would ensure the specified connection. It currently does not do that.

image

Let's fix this.

Running the following command:

m365 login --ensure --connectionName "some-name"

...should ensure that the specified connection is not expired and kickstart the login process if it is.
If the connectionName is not available, it means it's a new connection anyway, and the login process must start as well,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the login command's existing handling for --ensure and --connectionName; the issue does not name a file or test. Run m365 login --ensure --connectionName "some-name" with an existing, expired, and unavailable connection, and consider the work done when each case ensures or starts login for the specified connection.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.