Commit 19db98f
authored
feat(cli): surface env-var credentials in logout and whoami (#1363)
* feat(cli): surface env-var credentials in logout and whoami
login already warns when CHECKLY_API_KEY/CHECKLY_ACCOUNT_ID are set,
since they override any persisted session. logout and whoami stayed
silent, so clearing the local session or running whoami after logout
still looked authenticated with no explanation.
Extract login's message into common-messages and reuse it so logout
warns that env vars keep you authenticated, and whoami notes when the
account is resolved from the environment.
* test(cli): normalize oclif warning wrap in logout e2e
oclif's this.warn() word-wraps the message and prefixes continuation
lines with ` › `, splitting "still authenticated through them" across
a line break. Strip the markers and collapse whitespace before matching
so the assertion is independent of terminal width.
* test(cli): assert logout warning with wrap-safe substring
Match the substring style used by the login e2e instead of normalizing
oclif's line wrapping. "authenticated" appears only in the logout
suffix and is a single word, so it can't be split across a wrapped
line.
* test(cli): drop redundant logout warning substring assertion
* test(cli): trim verbose comments in auth e2e tests1 parent 5579d16 commit 19db98f
6 files changed
Lines changed: 18 additions & 3 deletions
File tree
- packages/cli
- e2e/__tests__
- src
- commands
- messages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
0 commit comments