lib/slackutil.js
/**
     * @brief Middeware function to verify the /ttt command token. This
     *        function checks if Slack is sending the correct token for the
     *        /ttt slash command. An error is sent if it is invalid.
     *
     * @param req express http request object
     * @param res express http response object
     * @param next express middleware next function
     *
     * @return none
     */
@brief Middeware function to verify the /ttt command token. This
function checks if Slack is sending the correct token for the
/ttt slash command. An error is sent if it is invalid.

@param req express http request object
@param res express http response object
@param next express middleware next function

@return none
@brief Middeware function to verify the / ttt command token . This function checks if Slack is sending the correct token for the / ttt slash command . An error is sent if it is invalid . @param req express http request object @param res express http response object @param next express middleware next function @return none
function verifyCommandToken(req, res, next) {
        if (req.method !== "POST") {
            next();
        }
        let token = req.body.token;
        if (token !== config.slack.TTT_COMMAND_TOKEN) {
            return res.status(400).end("Incorrect Token!");
        }
        next();
    }
function verifyCommandToken ( req , res , next ) { if ( req . method !== "POST" ) { next ( ) ; } let token = req . body . token ; if ( token !== config . slack . TTT_COMMAND_TOKEN ) { return res . status ( 400 ) . end ( "Incorrect Token!" ) ; } next ( ) ; }
@brief Middeware function to verify the /ttt command token.
@brief Middeware function to verify the / ttt command token .