koajs / csrf

CSRF tokens for koa
MIT License
264 stars 32 forks source link

Added excludedHosts #57

Closed teawithfruit closed 2 years ago

teawithfruit commented 4 years ago

Added excludedHosts to make communication between docker container possible without a token.

titanism commented 2 years ago

You can instead do something like this:

app.use((ctx, next) => {
  // detect if it's docker
  if (isDocker) return next();
  return new CSRF({ ... })(ctx, next);
});