#2892 Fix the order of the before_request functions
Merged by pingou. Opened by pingou.
fix_local_auth  into  master

Download 2892.patch

Local authentication needs to call _check_session_cookie before the
request is ran but that call requires a session to connect to the
database with and that is done in set_request so instead of ensuring
_check_session_cookie is always run first, make it be after set_request.

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

I want to add unit-tests for this, but not sure if I'll be able to do them today so pushing this in the mean time but won't merge w/o the tests :)

rebased onto a7431d0fe44ee9fde8ed2ae7e340b54ec8987f47

rebased onto 7e3e8698a4abe508289e9b00882394637f0857bf

5 new commits added

  • Fix the local login
  • Set the end_request be called at the end of the request earlier.
  • Reduce the number of calls to authenticated() in favor of flask.g
  • Rename the session variable to visit_session
  • Fix the order of the before_request functions

1 new commit added

  • Fix checking if the user is authenticated

Ok, this is now ready for review :)

Thanks, pingou! I can confirm that this fixes the problem I was having.

LGTM

Thanks for the review!

rebased onto 61ac283c383c844b47a6124498e6b18b516a28eb

Pull-Request has been merged by pingou

Metadata