MCPcopy Index your code
hub / github.com/tinode/chat / read_auth_cookie

Function read_auth_cookie

chatbot/python/chatbot.py:292–305  ·  view source on GitHub ↗

Read authentication token from a file

(cookie_file_name)

Source from the content-addressed store, hash-verified

290 log("Disconnected:", err)
291
292def read_auth_cookie(cookie_file_name):
293 """Read authentication token from a file"""
294 cookie = open(cookie_file_name, 'r')
295 params = json.load(cookie)
296 cookie.close()
297 schema = params.get("schema")
298 secret = None
299 if schema == None:
300 return None, None
301 if schema == 'token':
302 secret = base64.b64decode(params.get('secret').encode('utf-8'))
303 else:
304 secret = params.get('secret').encode('utf-8')
305 return schema, secret
306
307def on_login(cookie_file_name, params):
308 global botUID

Callers 1

runFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…