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

Question:

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!

Asked By: Pratik Ghodke

||

Answers:

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.

Answered By: MasOOd.KamYab
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.