Skip to content

Commit

Permalink
Check request is from assistant
Browse files Browse the repository at this point in the history
Change-Id: I39a29c29b7155ed4a8b272819c6bbe090c592882
  • Loading branch information
Leon Nicholls committed Nov 29, 2016
1 parent bb406b7 commit 03e5baa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ app.post('/', function (request, response) {
console.log('handle post');
const assistant = new ActionsSdkAssistant({request: request, response: response});

if (assistant.isRequestFromAssistant('MY_SECRET_KEY')) {
console.log('Request is from assistant');
} else {
console.log('Request is NOT from assistant');
return;
}

function mainIntent (assistant) {
console.log('mainIntent');
let inputPrompt = assistant.buildInputPrompt(true, '<speak>Hi! <break time="1"/> ' +
Expand Down

0 comments on commit 03e5baa

Please sign in to comment.