O
O
OrangeXD2016-08-20 11:13:59
Flask
OrangeXD, 2016-08-20 11:13:59

How to implement login in flask-security on the main page, and not on a separate one?

There is an application on Flask, there is a Flask-Security login and registration module. In its original form, the module login and registration occur on a separate page. Moved the route to the login on the main page ( app.route('/') ), inserted the forms into the template. However, now after login, when redirecting to the main page, I get a cyclic redirect. How to fix this without removing the login from the main one?

Flask-Security config:

SECURITY_POST_REGISTER_VIEW = '/success'
SECURITY_REGISTER_USER_TEMPLATE = '/register/register.html'
SECURITY_LOGIN_USER_TEMPLATE = '/register/home.html'
SECURITY_LOGIN_URL = '/'
SECURITY_POST_LOGIN_VIEW = 'profile'
SECURITY_UNAUTHORIZED_VIEW = '/'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mgremlin, 2016-08-25
@OrangeXD

And why on the main login?
Isn't it easier to leave the main one as the main one, make the login on a separate one, and from the main one do an automatic redirect to it if the client is not logged in?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question