From 733edd2ffd3a6ff4885cb0c39714aed5f7d1b364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BCrker=20Tunal=C4=B1?= Date: Wed, 4 Sep 2024 19:24:42 +0300 Subject: [PATCH] fix: Enhance the error message of the connected app authorization. Error were "Invalid state". The reason was user who created the token. So we've added a little bit more context here. (cherry picked from commit 4ad55b98c28d4c342808d166e7c124b89729607e) --- frappe/integrations/doctype/connected_app/connected_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/integrations/doctype/connected_app/connected_app.py b/frappe/integrations/doctype/connected_app/connected_app.py index 0a98869aab..d222374442 100644 --- a/frappe/integrations/doctype/connected_app/connected_app.py +++ b/frappe/integrations/doctype/connected_app/connected_app.py @@ -194,7 +194,7 @@ def callback(code=None, state=None): token_cache = frappe.get_doc("Token Cache", connected_app.name + "-" + frappe.session.user) if state != token_cache.state: - frappe.throw(_("Invalid state.")) + frappe.throw(_("Invalid state! Check if token is created by the oath user.")) oauth_session = connected_app.get_oauth2_session(init=True) query_params = connected_app.get_query_params()