Commit 2dff5b7
authored
🪲 [Fix]: Skip revoke token if token is expired (#488)
## Description
This pull request refactors the conditional logic in the
`Disconnect-GitHubAccount` function to improve readability and debugging
and that actually skips the revocation of the token if it is expired.
Refactoring and debugging improvements:
* Added a condition to check if the token is expired before running the
`Revoke-GitHubAppInstallationAccessToken`. The issue here was that the
function would fail if it was expired.
* Split the previous compound conditional into three distinct variables:
`$isNotGitHubToken`, `$isIATAuthType`, and `$isNotExpired` for clarity
and maintainability.
* Added `Write-Debug` statements for each condition to facilitate easier
troubleshooting and understanding of the script's flow.
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [x] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] 1 parent 6b2e03e commit 2dff5b7
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
0 commit comments