mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-28 11:20:10 +08:00
Heavy work on confirmation and reset
This commit is contained in:
@@ -114,6 +114,8 @@ def create_sqlalchemy_app(auth_config=None):
|
||||
confirmation_token = db.Column(db.String(255))
|
||||
confirmation_sent_at = db.Column(db.DateTime())
|
||||
confirmed_at = db.Column(db.DateTime())
|
||||
reset_password_token = db.Column(db.String(255))
|
||||
reset_password_sent_at = db.Column(db.DateTime())
|
||||
roles = db.relationship('Role', secondary=roles_users,
|
||||
backref=db.backref('users', lazy='dynamic'))
|
||||
|
||||
@@ -147,6 +149,8 @@ def create_mongoengine_app(auth_config=None):
|
||||
confirmation_token = db.StringField(max_length=255)
|
||||
confirmation_sent_at = db.DateTimeField()
|
||||
confirmed_at = db.DateTimeField()
|
||||
reset_password_token = db.StringField(max_length=255)
|
||||
reset_password_sent_at = db.DateTimeField()
|
||||
roles = db.ListField(db.ReferenceField(Role), default=[])
|
||||
|
||||
Security(app, MongoEngineUserDatastore(db, User, Role))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% include "_messages.html" %}
|
||||
{% include "_nav.html" %}
|
||||
<form action="{{ url_for('flask_security.register') }}" method="POST" name="register_form">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.email.label }} {{ form.email }}<br/>
|
||||
{{ form.password.label }} {{ form.password }}<br/>
|
||||
{{ form.password_confirm.label }} {{ form.password_confirm }}<br/>
|
||||
{{ form.submit }}
|
||||
{{ register_user_form.hidden_tag() }}
|
||||
{{ register_user_form.email.label }} {{ register_user_form.email }}<br/>
|
||||
{{ register_user_form.password.label }} {{ register_user_form.password }}<br/>
|
||||
{{ register_user_form.password_confirm.label }} {{ register_user_form.password_confirm }}<br/>
|
||||
{{ register_user_form.submit }}
|
||||
</form>
|
||||
<p>{{ content }}</p>
|
||||
|
||||
Reference in New Issue
Block a user