Ring middleware to prevent CSRF attacks