verifyToken = async (token, type) => {
  const payload = jwt.verify(token, config.jwt.secret);
  const tokenDoc = await Token.findOne({ token, type, user: payload.sub, blacklisted: false });
  if (!tokenDoc) {
    throw new Error('Token not found');
  }
  return tokenDoc;
}
Verify token and return token doc (or throw an error if it is not valid)
@param {string} token
@param {string} type
@returns {Promise<Token>}