diff options
| author | FivePixels <o5pxels@gmail.com> | 2022-11-16 16:50:25 -0600 |
|---|---|---|
| committer | FivePixels <o5pxels@gmail.com> | 2022-11-16 16:50:25 -0600 |
| commit | 43c1773876c6e37963b88843fec6c488d1db445e (patch) | |
| tree | d76bf7b8046be24b5c8efd8821d4d37731130630 /app/forms | |
| parent | 4ce25da944cf72c0af0a16ba229156eaba2fe0b1 (diff) | |
| download | Strengthy-43c1773876c6e37963b88843fec6c488d1db445e.tar.xz Strengthy-43c1773876c6e37963b88843fec6c488d1db445e.zip | |
(#1) Lengthen CSRF token expiry time to two hours
Diffstat (limited to 'app/forms')
| -rw-r--r-- | app/forms/workout.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/forms/workout.py b/app/forms/workout.py index a06c771..8714d5b 100644 --- a/app/forms/workout.py +++ b/app/forms/workout.py @@ -1,4 +1,7 @@ from flask_wtf import FlaskForm, Form +from wtforms.csrf.session import SessionCSRF +from datetime import timedelta +from os import urandom from wtforms import ( FieldList, FormField, @@ -38,4 +41,9 @@ class ExerciseRecordForm(Form): class WorkoutRecordForm(FlaskForm): + class Meta: + csrf = True + csrf_class = SessionCSRF + csrf_secret = urandom(16) + csrf_time_limit = timedelta(minutes=120) exercises = FieldList(FormField(ExerciseRecordForm)) |
