Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can flask_login still work if Flask is being used at server side (backend) only?

I am working on a web app where Flask is used as backend and react as frontend. I was wondering if flask’s flask-login extension which handle login and logout of users, can be used in this scenario. Flask is purely used at server side and deals with only API requests and sends response to frontend. Can flask-login handle user authentication and management (login/logout) in such case?

Thanks!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes, Flask-Login can still be used if Flask is only being used on the server-side (or backend) of an application. Flask-Login is a Flask extension that provides user session management, which is useful for maintaining user authentication and access control in a Flask application. It works by adding a layer of functionality to the Flask application that handles common tasks related to user sessions, such as logging users in and out, and checking whether a user is authenticated before allowing them to access certain routes or views in the application.

Flask-Login can still work if Flask is only being used at the server-side (backend) and the frontend is hosted on a different machine. Flask-Login uses cookies and sessions to handle user authentication, and these can be shared across different machines as long as they are on the same domain. As long as the frontend and backend are configured to communicate with each other, Flask-Login will be able to handle user authentication on the backend.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading