-1

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.

enter image description here

Sapan Soni
  • 59
  • 1
  • 4
  • Please don't share code as a screenshot. Instead, provide code as text, and use Markdown to format it as code. As a screenshot, it's difficult to copy/paste in order to reproduce or modify for the purposes of the question. – Jeremy Caney Jun 29 '21 at 19:40

1 Answers1

0

I solved the issue using jwt , as we are using angular as frontend , flask was not able to store the session for each user

Sapan Soni
  • 59
  • 1
  • 4