remove several debug print statements
This commit is contained in:
parent
3180353bb5
commit
f756453b34
|
@ -188,9 +188,9 @@ def set_new_access_token_in_cookie(
|
|||
if hasattr(tld, "new_id_token") and tld.new_id_token:
|
||||
response.set_cookie("id_token", tld.new_id_token)
|
||||
|
||||
if hasattr(tld, 'user_has_logged_out') and tld.user_has_logged_out:
|
||||
response.set_cookie("id_token", '', max_age=0)
|
||||
response.set_cookie("access_token", '', max_age=0)
|
||||
if hasattr(tld, "user_has_logged_out") and tld.user_has_logged_out:
|
||||
response.set_cookie("id_token", "", max_age=0)
|
||||
response.set_cookie("access_token", "", max_age=0)
|
||||
|
||||
_clear_auth_tokens_from_thread_local_data()
|
||||
|
||||
|
@ -259,13 +259,10 @@ def login_return(code: str, state: str, session_state: str) -> Optional[Response
|
|||
AuthenticationService.store_refresh_token(
|
||||
user_model.id, auth_token_object["refresh_token"]
|
||||
)
|
||||
redirect_url = (
|
||||
f"{state_redirect_url}"
|
||||
)
|
||||
redirect_url = state_redirect_url
|
||||
tld = current_app.config["THREAD_LOCAL_DATA"]
|
||||
tld.new_access_token = auth_token_object["access_token"]
|
||||
tld.new_id_token = auth_token_object["id_token"]
|
||||
print(f"REDIRECT_URL: {redirect_url}")
|
||||
return redirect(redirect_url)
|
||||
|
||||
raise ApiError(
|
||||
|
|
|
@ -62,7 +62,6 @@ class AuthenticationService:
|
|||
def open_id_endpoint_for_name(cls, name: str) -> str:
|
||||
"""All openid systems provide a mapping of static names to the full path of that endpoint."""
|
||||
openid_config_url = f"{cls.server_url()}/.well-known/openid-configuration"
|
||||
print(f"openid_config_url: {openid_config_url}")
|
||||
if name not in AuthenticationService.ENDPOINT_CACHE:
|
||||
response = requests.get(openid_config_url)
|
||||
AuthenticationService.ENDPOINT_CACHE = response.json()
|
||||
|
@ -93,7 +92,6 @@ class AuthenticationService:
|
|||
@staticmethod
|
||||
def generate_state(redirect_url: str) -> bytes:
|
||||
"""Generate_state."""
|
||||
print(f"REDIRECT_URL_HEY: {redirect_url}")
|
||||
state = base64.b64encode(bytes(str({"redirect_url": redirect_url}), "UTF-8"))
|
||||
return state
|
||||
|
||||
|
@ -102,7 +100,6 @@ class AuthenticationService:
|
|||
) -> str:
|
||||
"""Get_login_redirect_url."""
|
||||
return_redirect_url = f"{self.get_backend_url()}{redirect_url}"
|
||||
print(f"RETURN_REDIRECT_URL_ONE: {return_redirect_url}")
|
||||
login_redirect_url = (
|
||||
self.open_id_endpoint_for_name("authorization_endpoint")
|
||||
+ f"?state={state}&"
|
||||
|
|
|
@ -3,6 +3,7 @@ from typing import Any
|
|||
from typing import List
|
||||
from typing import Union
|
||||
|
||||
from flask import current_app
|
||||
from flask_bpmn.api.api_error import ApiError
|
||||
from flask_bpmn.models.db import db
|
||||
|
||||
|
@ -57,7 +58,7 @@ class ErrorHandlingService:
|
|||
)
|
||||
except Exception as e:
|
||||
# hmm... what to do if a notification method fails. Probably log, at least
|
||||
print(e)
|
||||
current_app.logger.error(e)
|
||||
|
||||
@staticmethod
|
||||
def hanle_sentry_notification(_error: ApiError, _recipients: List) -> None:
|
||||
|
|
|
@ -42,7 +42,6 @@ class MessageService:
|
|||
message_type="receive", status="ready"
|
||||
).all()
|
||||
for message_instance_send in message_instances_send:
|
||||
# print(f"message_instance_send.id: {message_instance_send.id}")
|
||||
# check again in case another background process picked up the message
|
||||
# while the previous one was running
|
||||
if message_instance_send.status != "ready":
|
||||
|
|
|
@ -55,9 +55,6 @@ class ServiceTaskDelegate:
|
|||
f"{connector_proxy_url()}/v1/do/{name}", json=params
|
||||
)
|
||||
|
||||
if proxied_response.status_code != 200:
|
||||
print("got error from connector proxy")
|
||||
|
||||
parsed_response = json.loads(proxied_response.text)
|
||||
|
||||
if "refreshed_token_set" not in parsed_response:
|
||||
|
@ -86,7 +83,7 @@ class ServiceTaskService:
|
|||
parsed_response = json.loads(response.text)
|
||||
return parsed_response
|
||||
except Exception as e:
|
||||
print(e)
|
||||
current_app.logger.error(e)
|
||||
return []
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in New Issue