flask-react-spa icon indicating copy to clipboard operation
flask-react-spa copied to clipboard

Question, disable csrf for specific endpoint

Open chriamue opened this issue 6 years ago • 2 comments

Do you have a tip, how to disable csrf for some views? I try to implement this: ` from flask_wtf import CSRFProtect csrf = CSRFProtect()

@csrf.exempt

@api.route(git, '/string:project_name/git-receive-pack', methods=('POST',))

def git_receive_pack(project_name): `

But decorator doesn't work for me. Is the a parameter for the api.route?

chriamue avatar Dec 23 '18 01:12 chriamue

Off the top of my head I'd guess trying to place the route decorator on the top? Can look more closely when I get to a computer

briancappello avatar Dec 23 '18 01:12 briancappello

Did not work for me, not on top, not on bot.

chriamue avatar Dec 23 '18 12:12 chriamue