Reputation: 59
I have built a web-based app using angular and material for which we are using flask as backend.
Now I am using the flask-login module for managing the users
Now my problem is when I authenticate and do login_user , I can print that user info using current_user.username in /login/ route
Now for some reason, I want to access current_user in other routes in the flask app, but when I tried to do so I get an error that anonymous user has no object called username
I am using mongoalchemy with my flask app. Below is the user class code I am using for this.
Upvotes: -1
Views: 231
Reputation: 59
I solved the issue using jwt , as we are using angular as frontend , flask was not able to store the session for each user
Upvotes: 0