-1

I just created my website but facing some issues, is there a way to check if someone is already logged in to an account and if so, user should be redirected to login page so that he/she can log in to a different account if he/she wishes. I'm using python with Django.

NelsonGon
  • 13,015
  • 7
  • 27
  • 57

1 Answers1

0

This may seem like a hack way but ,you could set a flag in the auth_user table eg: create a colunm bln_login by setting default as false,set it true each time you login,and set it false when you logout or when session is over ,and create the api as in when the bln_login flag is true don't let the user to login to the account' hope you found it helpful

  • @charles_mathew The issue with my website is that whenever first user logs into, any other user visiting the website lands on the active user page instead of being asked to log in to his account, I'm I missing something in my code? – Tedy Kimutai Jan 22 '22 at 16:12