src/lib/db.js
function deleteToken(username, token, done) {
  return tokenExists(username, token, function(existsErr, tokenObj) {
    if (existsErr) {
      return done(existsErr);
    }

    if (!tokenObj) {
      return done(new Error(`token '${token}' not found`));
    }

    return tokenObj.destroy(done);
  });
}
function deleteToken(username, token, done) {
  return tokenExists(username, token, function(existsErr, tokenObj) {
    if (existsErr) {
      return done(existsErr);
    }

    if (!tokenObj) {
      return done(new Error(`token '${token}' not found`));
    }

    return tokenObj.destroy(done);
  });
}
function deleteToken ( username , token , done ) { return tokenExists ( username , token , function ( existsErr , tokenObj ) { if ( existsErr ) { return done ( existsErr ) ; } if ( ! tokenObj ) { return done ( new Error ( ` ${ token } ` ) ) ; } return tokenObj . destroy ( done ) ; } ) ; }
Destroy a token. Username is required as we use it to search through
tokens.

@param {String} username
@param {String} token
@param {Function} done - done(err)
Destroy a token . Username is required as we use it to search through tokens .