I have an API and am trying to connect to an online store but every time I try to perform a POST an OPTIONS is returned. I decided to use JWT to authenticate requests and avoid OPTIONS but to no avail.
app.post('/auth', function(req,res){
var username = 114881;
var token = jwt.sign(username, app.get('superSecret'), { expiresInMinutes: 60});
res.send(token);
}
Returns the following error:
POST / auth 500 0.650 ms - 2086
Error: "expiresInMinutes" is not allowed in "options"
I've tried everything you can try but all without success, with CORS, setHEADERS, etc ...
Has anyone ever had the same problem?