mirror of
https://github.com/simple-login/app.git
synced 2024-09-27 20:31:30 +02:00
fix reset password expired
This commit is contained in:
parent
43536734a0
commit
4227c3036d
@ -144,8 +144,9 @@ def send_reset_password_email(user):
|
||||
"""
|
||||
generate a new ResetPasswordCode and send it over email to user
|
||||
"""
|
||||
# the activation code is valid for 1h
|
||||
reset_password_code = ResetPasswordCode.create(
|
||||
user_id=user.id, code=random_string(60)
|
||||
user_id=user.id, code=random_string(60), expired=arrow.now().shift(hours=1)
|
||||
)
|
||||
db.session.commit()
|
||||
|
||||
|
@ -207,8 +207,7 @@ class ResetPasswordCode(db.Model, ModelMixin):
|
||||
|
||||
user = db.relationship(User)
|
||||
|
||||
# the activation code is valid for 1h
|
||||
expired = db.Column(ArrowType, default=arrow.now().shift(hours=1), nullable=False)
|
||||
expired = db.Column(ArrowType, nullable=False)
|
||||
|
||||
|
||||
class Partner(db.Model, ModelMixin):
|
||||
|
Loading…
Reference in New Issue
Block a user