fix: validate social login key JSON fields (#33622)
Any misconfiguration would break login page otherwise Resolves #33579 Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
4acd07eaa4
commit
debd500cf3
1 changed files with 11 additions and 0 deletions
|
|
@ -89,6 +89,17 @@ class SocialLoginKey(Document):
|
|||
frappe.throw(
|
||||
_("Please enter Client Secret before social login is enabled"), exc=ClientSecretNotSetError
|
||||
)
|
||||
if self.auth_url_data:
|
||||
try:
|
||||
json.loads(self.auth_url_data)
|
||||
except json.JSONDecodeError:
|
||||
frappe.throw(_("Auth URL data should be valid JSON"))
|
||||
|
||||
if self.api_endpoint_args:
|
||||
try:
|
||||
json.loads(self.api_endpoint_args)
|
||||
except json.JSONDecodeError:
|
||||
frappe.throw(_("API Endpoint Args should be valid JSON"))
|
||||
|
||||
def set_icon(self):
|
||||
icon_map = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue