Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RevokedTokenModel(db.Model):
- __tablename__ = 'revoked_tokens'
- id = db.Column(db.Integer, primary_key = True)
- jti = db.Column(db.String(120))
- def add(self):
- db.session.add(self)
- db.session.commit()
- @classmethod
- def is_jti_blacklisted(cls, jti):
- query = cls.query.filter_by(jti = jti).first()
- return bool(query)
Add Comment
Please, Sign In to add comment