You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
To further explain the issue, if I call yelp.search() from within the module, everything works out and I receive data. However if I call that very same function using module.exports function I receive an invalid signature error.
Error:
{"error": {"text": "Signature was invalid", "id": "INVALID_SIGNATURE", "description": "Invalid signature. Expected signature base string: GET\u0026http%3A%2F%2Fapi.yelp.com%2Fv2%2Fsearch\u0026location%3DReno%252C%2520NV%26oauth_consumer_key%3D_removed_%26oauth_nonce%3D_removed_%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1389681156%26oauth_token%3D_removed_%26oauth_version%3D1.0%26term%3D"}}
Here is my code.
var yelp = require("yelp").createClient({
consumer_key: "my_consumer_key",
consumer_secret: "my_consumer_secret",
token: "my_token",
token_secret: "my_token_secret"
});
module.exports = {
search: function(req, res, callbacker) {
// Does not work and throws Invalid Signature error
yelp.search({term: "", location: "Reno, NV"}, function(error, data) {
if (data) console.log(data);
});
}
}
// Works as expected here.
yelp.search({term: "", location: "Reno, NV"}, function(error, data) {
if (data) console.log(data);
});
What could the issue be?
The text was updated successfully, but these errors were encountered:
Also, to note. If I just wrap yelp.search() in another function (outside module.exports) and call that from module.exports->search(), it still throws the error.
To further explain the issue, if I call
yelp.search()
from within the module, everything works out and I receive data. However if I call that very same function using module.exports function I receive aninvalid signature
error.Error:
Here is my code.
What could the issue be?
The text was updated successfully, but these errors were encountered: