From 8f4e4bdf8f1d66dc1a5a029530e95ab8cbd0279c Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Wed, 22 Nov 2023 20:36:18 +0530 Subject: [PATCH] changes to how debug mode appinfo is logged --- supertokens/supertokens.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/supertokens/supertokens.go b/supertokens/supertokens.go index a846e82f..c282791a 100644 --- a/supertokens/supertokens.go +++ b/supertokens/supertokens.go @@ -58,7 +58,20 @@ func supertokensInit(config TypeInput) error { LogDebugMessage("Started SuperTokens with debug logging (supertokens.Init called)") - appInfoJsonString, _ := json.Marshal(config.AppInfo) + // we do this below because we cannot marshal a function. + jsonableStruct := map[string]interface{}{ + "AppName": config.AppInfo.AppName, + "Origin": config.AppInfo.Origin, + "WebsiteDomain": config.AppInfo.WebsiteDomain, + "APIDomain": config.AppInfo.APIDomain, + "WebsiteBasePath": config.AppInfo.WebsiteBasePath, + "APIBasePath": config.AppInfo.APIBasePath, + "APIGatewayPath": config.AppInfo.APIGatewayPath, + } + if config.AppInfo.GetOrigin != nil { + jsonableStruct["Origin"] = "function" + } + appInfoJsonString, _ := json.Marshal(jsonableStruct) LogDebugMessage("AppInfo: " + string(appInfoJsonString)) var err error