mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user