Skip to content

Commit

Permalink
Add Flask CSRF protect
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Jul 6, 2024
1 parent fba3f77 commit 56ed8be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dill==0.3.8
distlib==0.3.8
filelock==3.14.0
Flask==3.0.3
Flask-WTF==1.2.1
functions-framework==3.7.0
grpcio==1.60.1
gunicorn==22.0.0
Expand Down Expand Up @@ -44,3 +45,4 @@ sniffio==1.3.1
virtualenv==20.26.2
watchdog==4.0.1
Werkzeug==3.0.3
WTForms==3.1.2
2 changes: 2 additions & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from dotenv import load_dotenv
from flask import Flask, request
from flask_wtf.csrf import CSRFProtect
from telegram import Bot

from main import webhook
Expand All @@ -17,6 +18,7 @@
NGROK_STATIC_DOMAIN = os.getenv("NGROK_STATIC_DOMAIN")

app = Flask(__name__)
csrf = CSRFProtect(app)


def start_ngrok():
Expand Down

0 comments on commit 56ed8be

Please sign in to comment.