Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
Allow ALEXA_APPLICATION_ID to be null
Browse files Browse the repository at this point in the history
  • Loading branch information
dmhacker committed Mar 4, 2020
1 parent 4096a09 commit 0b2540d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,15 @@ function ping_on_blocking_download(id, callback) {
}

app.pre = function(req, res, type) {
if (req.data.session !== undefined) {
if (req.data.session.application.applicationId !== process.env.ALEXA_APPLICATION_ID) {
res.fail("Invalid application");
}
} else {
if (req.applicationId !== process.env.ALEXA_APPLICATION_ID) {
res.fail("Invalid application");
if (process.env.ALEXA_APPLICATION_ID != null) {
if (req.data.session !== undefined) {
if (req.data.session.application.applicationId !== process.env.ALEXA_APPLICATION_ID) {
res.fail("Invalid application");
}
} else {
if (req.applicationId !== process.env.ALEXA_APPLICATION_ID) {
res.fail("Invalid application");
}
}
}
};
Expand Down

0 comments on commit 0b2540d

Please sign in to comment.