Добавлена двухфакторная регистрация через email

This commit is contained in:
2021-07-14 16:55:06 +03:00
parent 729012ecca
commit 4cad60b47f
12 changed files with 188 additions and 65 deletions

View File

@@ -19,19 +19,19 @@
<div id="navbarMenuHeroA" class="navbar-menu">
<div class="navbar-end">
<a href="{{ url_for('main.index') }}" class="navbar-item">
Home
Домой
</a>
{% if not current_user.is_authenticated %}
<a href="{{ url_for('auth.login') }}" class="navbar-item">
Login
Вход
</a>
<a href="{{ url_for('auth.signup') }}" class="navbar-item">
Sign Up
Регистрация
</a>
{% endif %}
{% if current_user.is_authenticated %}
<a href="{{ url_for('auth.logout') }}" class="navbar-item">
Logout
Выйти
</a>
{% endif %}
{% if current_user.is_authenticated %}

View File

@@ -2,9 +2,9 @@
{% block content %}
<h1 class="title">
Flask Login Example
Dyxless
</h1>
<h2 class="subtitle">
Easy authentication and authorization in Flask.
Заготовка web-приложения
</h2>
{% endblock %}

View File

@@ -2,7 +2,7 @@
{% block content %}
<div class="column is-4 is-offset-4">
<h3 class="title">Login</h3>
<h3 class="title">Вход</h3>
<div class="box">
{% with messages = get_flashed_messages() %}
{% if messages %}
@@ -14,22 +14,22 @@
<form method="POST" action="/login">
<div class="field">
<div class="control">
<input class="input is-large" type="email" name="email" placeholder="Your Email" autofocus="">
<input class="input is-large" type="email" name="email" placeholder="Email" autofocus="">
</div>
</div>
<div class="field">
<div class="control">
<input class="input is-large" type="password" name="password" placeholder="Your Password">
<input class="input is-large" type="password" name="password" placeholder="Пароль">
</div>
</div>
<div class="field">
<label class="checkbox">
<input type="checkbox">
Remember me
Запомнить меня
</label>
</div>
<button class="button is-block is-info is-large is-fullwidth">Login</button>
<button class="button is-block is-info is-large is-fullwidth">Войти</button>
</form>
</div>
</div>

View File

@@ -0,0 +1,3 @@
<p>Перейдите по ссылке для подтверждения регистрации</p>
<p><a href="{{ confirm_url }}">{{ confirm_url }}</a></p>
<br>

View File

@@ -2,6 +2,6 @@
{% block content %}
<h1 class="title">
Welcome, {{ current_user.name }}!
Добро пожаловать, {{ current_user.username }}!
</h1>
{% endblock %}

View File

@@ -2,12 +2,12 @@
{% block content %}
<div class="column is-4 is-offset-4">
<h3 class="title">Sign Up</h3>
<h3 class="title">Регистрация</h3>
<div class="box">
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="notification is-danger">
{{ messages[0] }}. Go to <a href="{{ url_for('auth.login') }}">login page</a>.
{{ messages[0] }}<a href="{{ url_for('auth.login') }}">Перейти к странице входа</a>.
</div>
{% endif %}
{% endwith %}
@@ -20,17 +20,17 @@
<div class="field">
<div class="control">
<input class="input is-large" type="text" name="name" placeholder="Name" autofocus="">
<input class="input is-large" type="text" name="username" placeholder="Имя пользователя" autofocus="">
</div>
</div>
<div class="field">
<div class="control">
<input class="input is-large" type="password" name="password" placeholder="Password">
<input class="input is-large" type="password" name="password" placeholder="Пароль">
</div>
</div>
<button class="button is-block is-info is-large is-fullwidth">Sign Up</button>
<button class="button is-block is-info is-large is-fullwidth">Зарегистрироваться</button>
</form>
</div>
</div>