lib/slackutil.js
/**
     * @brief This function authenticates the Slack API token using the
     *        web auth.test function. This is done only once when the
     *        application starts up.
     *
     * @param callback function invoked when authentication is complete:
     *                 function cb(error, authInfo)
     *
     * @return none
     */
@brief This function authenticates the Slack API token using the
web auth.test function. This is done only once when the
application starts up.

@param callback function invoked when authentication is complete:
function cb(error, authInfo)

@return none
@brief This function authenticates the Slack API token using the web auth . test function . This is done only once when the application starts up . @param callback function invoked when authentication is complete : function cb ( error authInfo ) @return none
function authenticateToken(callback) {
        webClient.auth.test(function (authError, info) {
            if (authError !== undefined && authError !== null) {
                return callback(authError);
            }
            if (info === undefined || info === null || info.ok !== true) {
                return callback(
                    new Error("Error processing token auth request:"),
                    info
                );
            }
            return callback(undefined, info);
        });
    }
function authenticateToken ( callback ) { webClient . auth . test ( function ( authError , info ) { if ( authError !== undefined && authError !== null ) { return callback ( authError ) ; } if ( info === undefined || info === null || info . ok !== true ) { return callback ( new Error ( "Error processing token auth request:" ) , info ) ; } return callback ( undefined , info ) ; } ) ; }
@brief This function authenticates the Slack API token using the
        web auth.test function.
@brief This function authenticates the Slack API token using the web auth . test function .
// Use the Slack web client to invoke the auth.test method. // auth.test API error // auth.test failed to authenticate the API token. // auth.test succeeded with ok = "true".