Commit 3d6651d
committed
fix: misleading error after OAuth is disabled
In the edge case where the user disables the OAuth authentication
while the authorization page is opened on the server, and then user
hits Allow, the URI executes. But the plugin tries to initialize
the rest api client and CLI without checking that OAuth is no
longer allowed. This raises a misleading error.
The fix is somewhat simple, before exchanging the authorization
code with an acces token we check if OAuth is still enabled and
if not we fail fast with a proper error message.
For cases where Cancel is selected by the user on the authorization
page we allow the flow to go as usual in Toolbox.
- raised coder/coder#24912 while investigating this issue
- resolves https://linear.app/codercom/issue/DEVEX-2221 parent 1081e74 commit 3d6651d
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
438 | 445 | | |
439 | 446 | | |
440 | 447 | | |
| |||
0 commit comments