Skip to content

Commit

Permalink
Extends m365 login with --ensure. Closes pnp#5217
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodecleyre authored and waldekmastykarz committed Oct 5, 2024
1 parent 66db729 commit ebf0952
Show file tree
Hide file tree
Showing 4 changed files with 559 additions and 78 deletions.
9 changes: 9 additions & 0 deletions docs/docs/cmd/login.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ m365 login [options]

`--connectionName [connectionName]`
: Specify an optional name to make switching between connections easier.

`--ensure`
: Ensures that the user is signed in. if the user isn't signed in, it initiates the login flow
```

<Global />
Expand Down Expand Up @@ -190,6 +193,12 @@ Log in to Microsoft 365 using a client secret.
m365 login --authType secret --secret topSeCr3t@007
```

Ensures that the user is signed in, initiates the login flow if the user isn't signed in

```sh
m365 login --ensure
```

## Response

<Tabs>
Expand Down
2 changes: 1 addition & 1 deletion src/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface Hash<TValue> {
[key: string]: TValue;
}

interface AccessToken {
export interface AccessToken {
expiresOn: Date | string | null;
accessToken: string;
}
Expand Down
Loading

0 comments on commit ebf0952

Please sign in to comment.