title: Why do findById method of a seuqelize model called both "then" and "catch"
body: <p>So I'm trying to use the passport-jwt with Sequelize model, and parse the user.id to an existing model in database. 
  The result is quite not what I have expected, it gives me a "headers have already been sent" error, which indicates that the passport-jwt has already sent the "Not found" to my client (which is just a curl with header given)</p>
  
  <pre><code>curl http://10.0.0.39/api/secure -H "Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJrb21tZW50anMuY29tIiwiaWF0IjoxNTE3MTY1MDkzLCJleHAiOjE1NDg3MDEwOTMsImF1ZCI6Ind3dy5leGFtcGxlLmNvbSIsInN1YiI6IjEyMyJ9.s1r6jkqBGZ8cAYEWdsvRVjHNohj2-aYzo-S_TH_2gAI"
  </code></pre>
  
  <p>The response on this sideis 
  <code>Not Found</code></p>
  
  <p>The sample code is attached below. The debug log indicate that the code actually called both ".then" clause and the ".catch" clause.</p>
  
  <p>Where do I make mistake?</p>
  
  <pre><code>import * as passportJwt from "passport-jwt"
  import {config} from "../../config"
  import {models} from "../../database"
  import {logger} from "../../logger"
  import { UserInterface, UserModel } from "../../models/user";
  const jwtOptions: passportJwt.StrategyOptions = {
      jwtFromRequest: passportJwt.ExtractJwt.fromAuthHeaderWithScheme("jwt"),
      secretOrKey: config.jwt.secret,
      issuer: config.jwt.issuer
  };
  let jwtStrategy = new passportJwt.Strategy(jwtOptions, async (payload,done)=&gt;{
      models.user.findById(parseInt(payload.sub)).then((user: UserInterface | null)=&gt;{
          if (user){
              console.log("user found");
              return done(null,user,payload);
          } else {
              console.log("user not found");
              return done(null,false,payload);
          }    
      }).catch((err)=&gt;{
          console.log("error");
          console.log(err);
          return done(err,false,null);
      });
  })
  export {jwtStrategy}
  </code></pre>
  
  <p>the debug log is like the following:</p>
  
  <pre><code>info: Executing (default): SELECT "id", "username", "isPrimary", "notificationList", "subscriptionList", "moderationList", "siteList", "connections", "avatar", "createdAt", "updatedAt" FROM "users" AS "user" WHERE "user"."id" = 123; logging=function (msg) {
        // build argument list (level, msg, ... [string interpolate], [{metadata}], [callback])
        var args = [level].concat(Array.prototype.slice.call(arguments));
        target.log.apply(target, args);
      }, plain=true, raw=false, where="user"."id" = 123, rejectOnEmpty=false, hooks=true, attributes=[id, username, isPrimary, notificationList, subscriptionList, moderationList, siteList, connections, avatar, createdAt, updatedAt], tableNames=[users], type=SELECT, model=class extends Model {} 
  </code></pre>
  
  <p>user not found 
  error 
  { AssertionError [ERR_ASSERTION]: headers have already been sent
          at Object.set status [as status] </p>
  
  <hr>
  
  <p>updated: tried with a different version, but use Promise style call to sequelize instead, still the same problem here.</p>
  
  <pre><code>let jwtStrategy = new passportJwt.Strategy(jwtOptions, (payload,done)=&gt;{
      models.user.findOne({where: {id: parseInt(payload.sub)}}).then((result: UserInterface | null)=&gt;{
          if (result){
              console.log("user found");
              return done (null, result, payload);
          } else {
              console.log("user not found");
              return done (null, false, "not found");
          }
      }).catch((err)=&gt;{
          console.log("error");
          console.log(err);
          return done(null, false, {message: err.message});
      })
  })
  </code></pre>