MCPcopy Create free account
hub / github.com/authlib/authlib / Token

Class Token

tests/flask/test_oauth2/models.py:69–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68
69class Token(db.Model, OAuth2TokenMixin):
70 id = db.Column(db.Integer, primary_key=True)
71 user_id = db.Column(db.Integer, db.ForeignKey("user.id", ondelete="CASCADE"))
72 user = db.relationship("User")
73
74 def is_refresh_token_active(self):
75 return not self.refresh_token_revoked_at
76
77 def get_client(self):
78 return db.session.query(Client).filter_by(client_id=self.client_id).one()
79
80 def get_user(self):
81 return self.user
82
83
84class CodeGrantMixin:

Callers 3

tokenFunction · 0.85
tokenFunction · 0.85
tokenFunction · 0.85

Calls

no outgoing calls

Tested by 3

tokenFunction · 0.68
tokenFunction · 0.68
tokenFunction · 0.68