我在 python 3.9 中有一个调用此代码的云函数:
firebase_admin.initialize_app()
def check_token(token, app_check_token):
"""
:param app_check_token:
:param token:
:return:
"""
try:
app_token = app_check.verify_token(app_check_token)
logging.info(f"App check token verified : {app_token}")
except Exception as e:
logging.error(f"Exception while decoding app check token : {e}")
try:
decoded_token = auth.verify_id_token(token)
logging.info(f"verified token : {decoded_token}")
if "uid" in decoded_token:
return decoded_token["uid"]
return ""
except Exception as e:
logging.error(f"check_token : {e}")
return ""
这是我使用有效的 firebase id 令牌调用我的函数时从 Cloud logging 获得的日志:
ERROR:root:check_token : 'HTTPResponse' object has no attribute 'strict'
请问这是什么意思?
注意:我有10个云函数,只有一个有这个问题,和其他的没有区别...
ChatGPT 说 Firebase 身份验证后端出错并联系 firbease 支持,但由于这只发生在我的一个云功能中,我想知道我是否做错了什么。
PS:如果我在本地运行这个云函数,一切都很好,
functions-framework --target function_name --debug --port=8080
使用完全相同的代码。