add session_id to token model

This commit is contained in:
Min RK
2021-11-16 12:07:46 +01:00
parent 8813bb63d4
commit 39f19aef49
4 changed files with 18 additions and 0 deletions

View File

@@ -58,6 +58,14 @@ class SelfAPIHandler(APIHandler):
model = get_model(user)
# add session_id associated with token
# added in 2.0
token = self.get_token()
if token:
model["session_id"] = token.session_id
else:
model["session_id"] = None
# add scopes to identify model,
# but not the scopes we added to ensure we could read our own model
model["scopes"] = sorted(self.expanded_scopes.difference(_added_scopes))