-
-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Describe the bug
When web auth is required an error occurs when g.user.is_authenticated() . This comes from Flask-Login as the function is now an attribute g.user.is_authenticated
To Reproduce
Steps to reproduce the behavior, e.g.:
- Configure GHC with
GQ_REQUIRE_WEBAPP_AUTH: True - Go to app
- Expect login prompt
- Seeing Internal Server Error
Expected Behavior
Expect login prompt
Screenshots or Logfiles
Log shows:
File "/GeoHealthCheck/GeoHealthCheck/app.py", line 112, in before_request
g.user.is_authenticated(), # This is from Flask-Login
TypeError: 'bool' object is not callable
Context (please complete the following information):
- OS: any
- Browser any
- Browser Version any
- Python Version 3.7
- GeoHealthCheck Version 0.8.0 and later
If running with Docker:
- GeoHealthCheck Docker Image version 0.8.0
Additional context
This was already an error when moving from Py2 to Py3. E.g. in all Jinja2 templates we had to change
g.user.is_authenticated() to g.user.is_authenticated as the function was changed to an attribute in Flask-Login.
Was introduced in 0.3.0: https://github.com/maxcountryman/flask-login/blob/master/CHANGES#L30
See also:
https://stackoverflow.com/questions/33062109/typeerror-bool-object-is-not-callable-g-user-is-authenticated