1
0
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:
Srdjan Markovic
2022-08-27 15:02:51 +02:00
committed by GitHub
parent 8bb63be8f5
commit 639a4473d7

View File

@@ -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
}