Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit 336548d

Browse files
committed
only get aog client id from app config if app is set
1 parent 7b06422 commit 336548d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

flask_assistant/core.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,13 @@ def __init__(
102102

103103
if app is not None:
104104
self.init_app(app)
105+
105106
elif blueprint is not None:
106107
self.init_blueprint(blueprint)
107108

109+
if self.client_id is None and self.app is not None:
110+
self.client_id = self.app.config.get("AOG_CLIENT_ID")
111+
108112
if project_id is None:
109113
import warnings
110114

@@ -393,18 +397,15 @@ def _set_user_profile(self):
393397

394398
token = self.user["idToken"]
395399
decode_resp = decode_token(token, self.client_id)
396-
if decode_resp["status"]=="BAD":
400+
if decode_resp["status"] == "BAD":
397401
return
398-
else: #decode_resp["status"]=="OK"
402+
else: # decode_resp["status"]=="OK"
399403
profile_payload = decode_resp["output"]
400404
for k in ["sub", "iss", "aud", "iat", "exp"]:
401405
profile_payload.pop(k)
402406

403407
self.profile = profile_payload
404408

405-
406-
407-
408409
def _flask_assitant_view_func(self, nlp_result=None, *args, **kwargs):
409410
if nlp_result: # pass API query result directly
410411
self.request = nlp_result

0 commit comments

Comments
 (0)