rDrama/files
painejohn 0e165e17c0 Fixes #110 "Signout doesn't always work"
I tried reproducing the issues from #110 but without luck. The
workflow looks a little like this:

- User changes their avatar.
    - This triggers a POST request to the profile endpoint.
- User clicks "Log out" from the dropdown menu"
    - This triggers the post_toast function in js that makes a POST to
      /logout, which clears the user's session. Then, on receipt of the
      response, the js calls `location.reload`, which replays the
      browser's last action, which in our case is the earlier POST
      request to the profile endpoint. This is why the browser asks
      whether it's OK to resubmit the data _again_. Agreeing resubmits
      the first POST request.
    - After `location.reload`, since the user is no longer logged in,
      they either get a 405 (from the profile edit page) or a 500 (from
      the profile overview page).

This PR then changes the `/logout` endpoint from POST to GET, then
updates the header template to change the "Log out" anchor to simply
link to "/logout" instead of calling any js.

Reasoning behind it:
- logout doesn't modify server-side resources, so it's safe to make it a
  GET request.
- Making it a GET prevents the browser from ever displaying the "data
  resubmit" warning window.
- The "/logout" endpoint can now simply redirect to the homepage.
2022-07-29 06:47:19 -05:00
..
assets Merge pull request #122 from zorbathut/pr_fixvote 2022-07-26 23:19:33 -04:00
classes Filter on other pages as well 2022-07-09 06:33:41 -05:00
commands [#72] Add seed_db command 2022-06-09 01:33:58 -07:00
helpers Remove the #fortune feature. 2022-07-23 06:00:38 -05:00
mail Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
routes Fixes #110 "Signout doesn't always work" 2022-07-29 06:47:19 -05:00
templates Fixes #110 "Signout doesn't always work" 2022-07-29 06:47:19 -05:00
tests Add basic posting to the e2e test. 2022-05-21 21:39:54 -05:00
__init__.py Initial e2e testing 2022-05-13 02:55:29 -05:00
__main__.py Allow use of mail servers besides Gmail. 2022-07-03 10:14:09 -05:00
cli.py [#72] Ensure seed_db command is actually imported when calling into flask 2022-06-09 01:34:46 -07:00