mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
DESEC: Check authentication via domains API (#1723)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
@@ -68,7 +68,12 @@ type nonFieldError struct {
|
||||
|
||||
func (c *desecProvider) authenticate() error {
|
||||
endpoint := "/auth/account/"
|
||||
var _, _, err = c.get(endpoint, "GET")
|
||||
var _, resp, err = c.get(endpoint, "GET")
|
||||
//restricted tokens are valid, but get 403 on /auth/account
|
||||
//invalid tokens get 401
|
||||
if resp.StatusCode == 403 {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user