chore: external auth validate response "Forbidden" should return invalid, not an error (#13446)

* chore: add unit test to delete workspace from suspended user
* chore: account for forbidden as well as unauthorized response codes
This commit is contained in:
Steven Masley
2024-06-03 13:16:51 -05:00
committed by GitHub
parent 0b019cad77
commit 27f26910b6
4 changed files with 98 additions and 9 deletions

View File

@ -218,7 +218,7 @@ func (c *Config) ValidateToken(ctx context.Context, link *oauth2.Token) (bool, *
return false, nil, err
}
defer res.Body.Close()
if res.StatusCode == http.StatusUnauthorized {
if res.StatusCode == http.StatusUnauthorized || res.StatusCode == http.StatusForbidden {
// The token is no longer valid!
return false, nil, nil
}