mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 21:27:10 +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
@ -115,7 +115,8 @@ def register():
|
|||||||
|
|
||||||
|
|
||||||
def send_activation_email(user, next_url):
|
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))
|
activation = ActivationCode.create(user_id=user.id, code=random_string(30))
|
||||||
Session.commit()
|
Session.commit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user