Skip to content

Commit

Permalink
Updates 'm365 status' command output. Closes #5849
Browse files Browse the repository at this point in the history
  • Loading branch information
nanddeepn authored and Adam-it committed Aug 13, 2024
1 parent 5299844 commit 256b86f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions docs/docs/v9-upgrade-guidance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ For this new major version, we've removed the deprecated `AAD` CLI environment v

Please, check the user guidance [Log in to Microsoft 365](./user-guide/connecting-microsoft-365.mdx) command to see the updated environment variables to use.

## CLI Status

### Removed deprecated CLI environment variables

We've updated the [m365 status](./cmd/status.mdx) command output. Previously the command would return `Logged out from Microsoft 365` now it will return `Logged out`.

#### What action do I need to take?

Please, update your scripts to reflect the new output of the [m365 status](./cmd/status.mdx) command.

## Entra ID

### Removed deprecated Guest value from 'aad m365group user list' command.
Expand Down
4 changes: 2 additions & 2 deletions src/m365/commands/status.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe(commands.STATUS, () => {
auth.connection.active = false;
(auth as any)._allConnections = [];
await command.action(logger, { options: { verbose: true } });
assert(loggerLogToStderrSpy.calledWith('Logged out from Microsoft 365'));
assert(loggerLogToStderrSpy.calledWith('Logged out'));
});

it('shows logged out status when not logged in with connections available', async () => {
Expand All @@ -132,7 +132,7 @@ describe(commands.STATUS, () => {
it('shows logged out status when not logged in with connections available (verbose)', async () => {
auth.connection.active = false;
await command.action(logger, { options: { verbose: true } });
assert(loggerLogToStderrSpy.calledWith('Logged out from Microsoft 365, signed in connections available'));
assert(loggerLogToStderrSpy.calledWith('Logged out, signed in connections available'));
});

it('shows logged out status when the refresh token is expired', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/m365/commands/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class StatusCommand extends Command {
const connections = await auth.getAllConnections();
if (this.verbose) {
const message = connections.length > 0
? `Logged out from Microsoft 365, signed in connections available`
: 'Logged out from Microsoft 365';
? `Logged out, signed in connections available`
: 'Logged out';
await logger.logToStderr(message);
}
else {
Expand Down

0 comments on commit 256b86f

Please sign in to comment.