MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / validate_token

Function validate_token

wxapp/BREO.py:159–173  ·  view source on GitHub ↗
(token)

Source from the content-addressed store, hash-verified

157 write_token_cache(cache)
158
159def validate_token(token):
160 try:
161 resp = session.post(
162 f"{APP_BASE}/getUserLevelInfoByUid",
163 headers=app_headers(token),
164 timeout=15,
165 )
166 if resp.status_code != 200:
167 return False
168 data = resp.json()
169 if is_success(data):
170 return True
171 return not is_token_error(data)
172 except Exception:
173 return False
174
175def get_token_for_account(account_id, index):
176 cached = get_cached_token(account_id)

Callers 1

get_token_for_accountFunction · 0.85

Calls 4

app_headersFunction · 0.85
is_successFunction · 0.85
is_token_errorFunction · 0.85
postMethod · 0.45

Tested by

no test coverage detected