diff --git a/internal/server/v1/warden/handler.go b/internal/server/v1/warden/handler.go index ad7c415..8acbd67 100644 --- a/internal/server/v1/warden/handler.go +++ b/internal/server/v1/warden/handler.go @@ -1,6 +1,7 @@ package warden import ( + "errors" "net/http" "github.com/goto/dex/internal/server/utils" @@ -17,11 +18,11 @@ func NewHandler(service *Service) *Handler { func (h *Handler) teamList(w http.ResponseWriter, r *http.Request) { teamListResp, err := h.service.TeamList(r.Context()) - if err == ErrUserNotFound { + if errors.Is(err, ErrUserNotFound) { utils.WriteErrMsg(w, http.StatusUnauthorized, ErrUserNotFound.Error()) return } - if err == ErrTeamNotFound { + if errors.Is(err, ErrTeamNotFound) { utils.WriteErrMsg(w, http.StatusNotFound, ErrTeamNotFound.Error()) return } diff --git a/internal/server/v1/warden/service.go b/internal/server/v1/warden/service.go index ae37fd6..29c1f0c 100644 --- a/internal/server/v1/warden/service.go +++ b/internal/server/v1/warden/service.go @@ -32,7 +32,7 @@ func (c *Service) TeamList(ctx context.Context) (*TeamData, error) { url := baseURL + endpoint + userPath + reqCtx.UserEmail + teamsEndpoint - resp, err := http.Get(url) + resp, err := http.Get(url) //nolint if err != nil { return nil, err