Commit 18eaee5
authored
fix: show different dialogs for authorization errors and other errors (#305)
This PR adds a new command `loginFailedNudge` which is different from the `loginNudge`. This command is intended to be the pop up dialog for any non-authorization errors occurred during login.
Reasons as to why we need to do this is documented here: semgrep/semgrep-proprietary#5938
This change should only be released after the change in the `semgrep-proprietary` repo is released and bumped in this repo.
## Test plan:
### Experimental LS
No token:
<img width="351" height="250" alt="image" src="https://github.com/user-attachments/assets/80c27218-c8f9-4f73-a00e-d46b421275cb" />
Network error:
<img width="351" height="250" alt="image" src="https://app.graphite.com/user-attachments/assets/aab1c8e2-1689-47f6-8fce-82cd45119838.png" />
and token was not cleared out.
Bad token (authorization error):
<img width="354" height="193" alt="image" src="https://github.com/user-attachments/assets/5d9e7eea-3c5e-4c0b-9664-739ca438ed6f" />
and token was not cleared out.
Also checked that rules were successfully refreshed for the valid token case
### Legacy:
No token:
<img width="347" height="248" alt="image" src="https://github.com/user-attachments/assets/d6ad590d-9902-420b-9552-c4aa264dc9e8" />
Network error:
<img width="357" height="282" alt="image" src="https://github.com/user-attachments/assets/0223c81e-4aa3-4f66-bd6a-a46446e34db6" />
and token wasn't cleared out.
Bad token (authorization error):
<img width="355" height="196" alt="image" src="https://github.com/user-attachments/assets/2a290e84-a729-4cf3-ab60-f669a9382cdb" />
and token wasn't cleared out.
Also checked that rules were successfully refreshed for the valid token case
PR checklist:
- [x] Purpose of the code is [evident to future readers](https://semgrep.dev/docs/contributing/contributing-code/#explaining-code)
- [x] Tests included or PR comment includes a reproducible test plan
- [x] Documentation is up-to-date
- [x] A changelog entry was for any user-facing change
- [x] Change has no security implications (otherwise, ping security team)
If you're unsure about any of this, please see:
- [Contribution guidelines](https://semgrep.dev/docs/contributing/contributing-code)!
- [One of the more specific guides located here](https://semgrep.dev/docs/contributing/contributing/)1 parent 1f185f9 commit 18eaee5
3 files changed
Lines changed: 44 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
86 | 95 | | |
87 | | - | |
88 | | - | |
| 96 | + | |
| 97 | + | |
89 | 98 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
99 | 109 | | |
100 | | - | |
101 | | - | |
| 110 | + | |
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
| |||
0 commit comments