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 flask import current_app
|
||||
from werkzeug.local import LocalProxy
|
||||
from secrets import compare_digest
|
||||
|
||||
logger = LocalProxy(lambda: current_app.logger)
|
||||
|
||||
class AccessToken(db.Model):
|
||||
|
@ -52,7 +54,7 @@ class AccessToken(db.Model):
|
|||
return dic
|
||||
|
||||
def __eq__(self, token):
|
||||
return self.token == token
|
||||
return compare_digest(self.token, token)
|
||||
|
||||
def __sub__(self, other):
|
||||
return other - self.timestamp
|
||||
|
|
Loading…
Reference in New Issue