Skip to content

Commit

Permalink
Remove expired tokens, refs #4
Browse files Browse the repository at this point in the history
  • Loading branch information
danielperna84 committed Jan 19, 2020
1 parent 5d2c247 commit 5721cb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hass_wh_triggers/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ def otp():
if token:
token.delete()
return redirect(url_for('tokens'))
now = time.time()
for token in OTPToken.query.all():
if now - token.created > token.max_age:
token.delete()
tokens = OTPToken.query.all()
users = []
for user in User.query.all():
Expand Down

0 comments on commit 5721cb2

Please sign in to comment.