I'm developing a flask application where I have implemented Azure AD based authentication. Now when user log in they can select 3 different app route based on their choice.
Inside each app route there is post method implemented on button click which start provisioning of resources such as Azure VM.
I want to start timer only when user click that button and redirect to /logout when timer ends.
Thanks in advance.
Have you tried doing it with sessions?
Then use some type of fetch/ajax that when you click the button at the same time a POST request to "/your_url" is triggered with an allocation of a session that would expire after 60 minutes.
Find the session you allocated and if it is not existing then proceed to logout. That's what flask-login and other flask projects seems to be doing as an approach.