mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 07:31:12 +01:00
Only allow latest activation code to be used (#2160)
(cherry picked from commit dd09297bead4ea27731ac3bd60fcf2a3e7001268)
This commit is contained in:
parent
a7aec0c37a
commit
1407c969d2
1 changed files with 2 additions and 1 deletions
|
@ -115,7 +115,8 @@ def register():
|
|||
|
||||
|
||||
def send_activation_email(user, next_url):
|
||||
# the activation code is valid for 1h
|
||||
# the activation code is valid for 1h and delete all previous codes
|
||||
Session.query(ActivationCode).filter(ActivationCode.user_id == user.id).delete()
|
||||
activation = ActivationCode.create(user_id=user.id, code=random_string(30))
|
||||
Session.commit()
|
||||
|
||||
|
|
Loading…
Reference in a new issue