Skip to content

Commit

Permalink
changes to how debug mode appinfo is logged
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Nov 22, 2023
1 parent c59e122 commit 8f4e4bd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion supertokens/supertokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8f4e4bd

Please sign in to comment.