⚠️
Please carefully read the full document before you start working
Create an application that helps users find public repositories hosted on Github and compare their stats.
function parse_signed_request(signed_request, secret) { | |
const encoded_data = signed_request.split(".",2); | |
// decode the data | |
const sig = encoded_data[0]; | |
let buffer = new Buffer(encoded_data[1], "base64"); | |
const json = buffer.toString("ascii"); | |
const data = JSON.parse(json); // ERROR Occurs Here! | |
// check algorithm - not relevant to error | |
if (!data.algorithm || data.algorithm.toUpperCase() != "HMAC-SHA256") { |