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
asyncfunctionhandleCsrf(request,reply,done){varsecret=getSecret(request,cookie);// cookie for csrf token not set.if(!secret){secret=awaittokens.secret();setSecret(request,reply,secret,cookie);}if(ignoreMethods.indexOf(request.req.method)<0&&!tokens.verify(secret,tokenIdentifier(request))){returndone(newError('invalid csrf token'));}done();}
Could be rewritten as:
asyncfunctionhandleCsrf(request,reply){varsecret=getSecret(request,cookie);// cookie for csrf token not set.if(!secret){secret=awaittokens.secret();setSecret(request,reply,secret,cookie);}if(ignoreMethods.indexOf(request.req.method)<0&&!tokens.verify(secret,tokenIdentifier(request))){thrownewError('invalid csrf token');}}
The text was updated successfully, but these errors were encountered:
As an example this https://github.com/Tarang11/fastify-csrf/blob/master/lib/fastifyCsrf.js#L20-L31:
Could be rewritten as:
The text was updated successfully, but these errors were encountered: