Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return __awaiter(this, void 0, void 0, function* () {
let activity = req.body;
try {
// authenticate the incoming request
var authHeader = req.headers["authorization"] || '';
yield botframework_connector_1.JwtTokenValidation.assertValidActivity(activity, authHeader, this.credentialsProvider);
}
catch (err) {
console.log(err);
res.send(401);
return;
}
try {
// call onReceive delegate
yield this.onReceive(activity);
// TODO: Add logic to return 'invoke' response
res.send(202);
}
catch (err) {
// TODO: Added logic to unpack error
res.send(500, err.message);
/*
authenticateRequest(request, authHeader) {
return botframework_connector_1.JwtTokenValidation.authenticateRequest(request, authHeader, this.credentialsProvider).then(claims => {
if (!claims.isAuthenticated) {
throw new Error('Unauthorized Access. Request is not authorized');
}
});
}
/**