mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-19 11:23:28 +08:00
Add login to security blueprint
This commit is contained in:
@@ -56,17 +56,6 @@ def create_app(auth_config):
|
||||
def index():
|
||||
return render_template('index.html', content='Home Page')
|
||||
|
||||
@app.route('/login')
|
||||
def login():
|
||||
if app.config['SECURITY_PASSWORDLESS']:
|
||||
form = PasswordlessLoginForm()
|
||||
template = 'passwordless_login'
|
||||
else:
|
||||
form = LoginForm()
|
||||
template = 'login'
|
||||
|
||||
return render_template(template + '.html', content='Login Page', form=form)
|
||||
|
||||
@app.route('/custom_login')
|
||||
def custom_login():
|
||||
return render_template('login.html', content='Custom Login Page', form=LoginForm())
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{%- if current_user.is_authenticated() -%}
|
||||
<a href="{{ url_for('security.logout') }}">Log out</a>
|
||||
{%- else -%}
|
||||
<a href="{{ url_for('login') }}">Log in</a>
|
||||
<a href="{{ url_for('security.login') }}">Log in</a>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user