Commit 722b75df authored by Erick Hitter's avatar Erick Hitter

Limit the users who can trigger a command

parent 136e13c7
{
"command_user" : "",
"wp_endpoint" : "",
"wp_username" : "",
"wp_password" : "",
......
......@@ -31,6 +31,16 @@ app.post( '/log', function( req, res ) {
return res.sendStatus( 400 );
}
// Limit who can trigger the command
if ( 'undefined' === typeof req.body.user_name || config.command_user !== req.body.user_name ) {
var response = {
"response_type": "ephemeral",
"text": "Sorry, you can't record completed tasks."
};
return res.send( response );
}
// Massage the title
var title = req.body.text;
title = striptags( title, [] );
......@@ -58,7 +68,7 @@ app.post( '/log', function( req, res ) {
"text": "**Entry recorded (**ID #" + resp.id + ", <" + resp.link + ">**)**\n" + resp.title.rendered
};
res.send( response);
res.send( response );
} );
} );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment