DESEC: Check authentication via domains API
@@ -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
}
