uchicago-capp-30320 / new-arrivals-chi

GNU Affero General Public License v3.0
9 stars 0 forks source link

Implement CSRF Protection for Login Process #164

Closed aaronhaefner closed 5 months ago

aaronhaefner commented 6 months ago

Describe your changes

This PR integrates CSRF protection into the login process to enhance security. Changes include:

Non-obvious technical information

We use Flask-WTF's generate_csrf() to create and validate tokens that secure forms against CSRF attacks. The token validation depends on the user's session, and incorrect or missing tokens result in an error, preventing potential CSRF attacks.

This setup ensures our login mechanism is secure against unauthorized cross-site requests.

Checklist before requesting a review