# rejectEmptyResponse produces 401

**URL:** <https://discuss.akka.io/t/rejectemptyresponse-produces-401/8728>\
**Category:** Uncategorized\
**Created:** [September 6, 2021, 9:03pm UTC](https://discuss.akka.io/t/rejectemptyresponse-produces-401/8728 "2021-09-06T21:03:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tony](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tony](https://discuss.akka.io/u/tony)\
**Post date:** [September 6, 2021, 9:03pm UTC](https://discuss.akka.io/t/rejectemptyresponse-produces-401/8728/1 "2021-09-06T21:03:33Z")

</div>

I have the following directive structure

```auto
path(Segment) { fooId =>
        concat(
          get {
            handleErrorsAndReport("get_foo") {
              rejectEmptyResponse(
                complete(
                    fooRepository
                    .find(fooId)
                    .map(FooOps.toFooModel)
                )
              )
            }
          },
          seal(
            authenticateBasic(
              realm = "Secure foo",
              scopesAuthenticator
            ) { scopes =>
              concat(
              ...
              )
            }
          )
        )
      }

```

When the find method of the get\_foo endpoint returns None - so the end result is complete(None) - the status code is 401 Unauthorized… I have no idea how can this be… Any ideas?
