Merge branch 'develop' into pluginify

This commit is contained in:
Ferdinand Thiessen 2020-08-25 22:38:57 +02:00
commit 48dd7ea6ec
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,8 @@ from datetime import datetime
from ..database import db from ..database import db
from flask import current_app from flask import current_app
from werkzeug.local import LocalProxy from werkzeug.local import LocalProxy
from secrets import compare_digest
logger = LocalProxy(lambda: current_app.logger) logger = LocalProxy(lambda: current_app.logger)
class AccessToken(db.Model): class AccessToken(db.Model):
@ -52,7 +54,7 @@ class AccessToken(db.Model):
return dic return dic
def __eq__(self, token): def __eq__(self, token):
return self.token == token return compare_digest(self.token, token)
def __sub__(self, other): def __sub__(self, other):
return other - self.timestamp return other - self.timestamp