title: Playframework: Type mismatch found scala.concurrent.Future[play.api.mvc.Result] required: play.api.mvc.Result
body: <p>I have the following code in my controller in PlayFramework:</p>
  
  <pre><code>  def auth = Action.async(parse.json) { request =&gt;
      {
  
        val authRequest = request.body.validate[AuthRequest]
        authRequest.fold(
          errors =&gt; Future(BadRequest),
          auth =&gt; {
            credentialsManager.checkEmailPassword(auth.email, auth.password).map {
  
              case Some(credential: Credentials) =&gt; {
  
                sessionManager.createSession(credential.authAccountId).map { //Throws an error
                  case Some(authResponse: AuthResponse) =&gt; Ok(Json.toJson(authResponse))
                  case None =&gt; InternalServerError
  
                }
  
              }
  
              case (None) =&gt; Unauthorized
            }
  
          })
      }
    }
  </code></pre>
  
  <p>I get the following error at the line with error comment above:</p>
  
  <pre><code>Type Mismatch:
  [error]  found   : scala.concurrent.Future[play.api.mvc.Result]
  [error]  required: play.api.mvc.Result
  [error]               sessionManager.createSession(credential.authAccountId).map {
  </code></pre>
  
  <p>The createSession call there returns a <code>Future[Option[Object]]</code> but I can't figure out how to fix this problem.</p>
  
  <p>Any help will be greatly appreciated.</p>