diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go index 77e875ec..3d6add04 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go @@ -309,7 +309,7 @@ func validateApplicationService( break } } - if matchedApplicationService != nil { + if matchedApplicationService == nil { return "", &util.JSONResponse{ Code: 401, JSON: jsonerror.UnknownToken("Supplied access_token does not match any known application service"),