code: function handleLogin(req, res, next) {
  		var p = new Promise(function (resolve, reject) {
  			const loginHandler = function (err, user, info) {
  				if (err) {
  					debug(`Error during user login`, err);
  					return reject(err);
  				}
  				if (!user) {
  					debug(`Login user not found or invalid credentials`, info);
  					reject(new restifyErrors.InvalidCredentialsError("Incorrect username or password"));
  				} else {
  					const data = {
  						'success': true,
  						'token': req.locals.basic_login_token
  					};
  					resolve(data);
  				}
  			};
  
  			debug(`Handling user login`);
  			passport.authenticate('basic', {
  				session: false
  			}, loginHandler)(req, res);
  		}).then(function (data) {
  			res.json(data);
  			next();
  		}).catch(function (err) {
  			debug(`Error during login request.`, err);
  			next(err);
  		});
  	}
docs: handleVerify *********************************************************