Guest User

Untitled

a guest
Nov 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. class RevokedTokenModel(db.Model):
  2. __tablename__ = 'revoked_tokens'
  3. id = db.Column(db.Integer, primary_key = True)
  4. jti = db.Column(db.String(120))
  5.  
  6. def add(self):
  7. db.session.add(self)
  8. db.session.commit()
  9.  
  10. @classmethod
  11. def is_jti_blacklisted(cls, jti):
  12. query = cls.query.filter_by(jti = jti).first()
  13. return bool(query)
Add Comment
Please, Sign In to add comment