Open lingering126 opened 1 month ago
I added this routes, and the bug fixed:
@pr.before_request
def before_request():
g.user = current_user if current_user.is_authenticated else None
this code sets g.user
to the currently logged-in user (if there is one) before each request, making the current_user
object available globally throughout the request.
I found that if the previous user hasn't logged out, run the flask app again and there will be a "user undefined" bug.![Screenshot 2024-05-16 220157](https://github.com/dayday0calories/CITS5505-Group-Project/assets/104363531/c6d24578-f2aa-42c7-a38b-dc0ad16462fe)