Merge branch 'develop' into pluginify
This commit is contained in:
commit
48dd7ea6ec
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue