code: function handleVerify(req, res, next) {
  		var p = new Promise(function (resolve, reject) {
  			const currentToken = req.params.token || false;
  			if (!currentToken || currentToken == 'missing') {
  				debug(`Verify request, token is missing.`);
  				return reject(new restifyErrors.BadRequestError("Verify token is missing"));
  			}
  
  			const postVerifyHandler = function (err, user, info) {
  				if (err) {
  					debug(`Error handling verify request.`, err);
  					return reject(new restifyErrors.InternalError(err));
  				}
  				// The API doesn't store any state in a session!
  				req.login(user, {
  					'session': false
  				}, function (err) {
  					if (err) {
  						debug(`Login failed during verify request.`, err);
  						return reject(new restifyErrors.InternalError("Failed logging in verified user"));
  					}
  					debug(`User is verified and logged in.`);
  					var data = {
  						'success': true,
  						'token': req.locals.basic_login_token
  					};
  					resolve(data);
  				});
  			};
  
  			passport.authenticate('local-verify', postVerifyHandler)(req, res);
  		}).then(function (data) {
  			res.json(data);
  			next();
  		}).catch(function (err) {
  			debug(`Error during verify request.`, err);
  			next(err);
  		});
  	}
docs: handleUserLogout *******************************************************