File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,5 @@ func LogDebugMessage(message string) {
2828 _ , exists := os .LookupEnv ("SUPERTOKENS_DEBUG" )
2929 if exists {
3030 logger .Printf (formatMessage (message ))
31-
3231 }
3332}
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ type TypeInput struct {
4646 AppInfo AppInfo
4747 RecipeList []Recipe
4848 Telemetry * bool
49+ Debug * bool
4950 OnSuperTokensAPIError func (err error , req * http.Request , res http.ResponseWriter )
5051}
5152
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
2020 "errors"
2121 "flag"
2222 "net/http"
23+ "os"
2324 "reflect"
2425 "strconv"
2526 "strings"
@@ -35,6 +36,7 @@ type superTokens struct {
3536 RecipeModules []RecipeModule
3637 OnSuperTokensAPIError func (err error , req * http.Request , res http.ResponseWriter )
3738 Telemetry * bool
39+ Debug * bool
3840}
3941
4042// this will be set to true if this is used in a test app environment
@@ -54,6 +56,14 @@ func supertokensInit(config TypeInput) error {
5456 superTokens .OnSuperTokensAPIError = config .OnSuperTokensAPIError
5557 }
5658
59+ superTokens .Debug = config .Debug
60+ if superTokens .Debug != nil && * superTokens .Debug {
61+ err := os .Setenv ("SUPERTOKENS_DEBUG" , "1" )
62+ if err != nil {
63+ return err
64+ }
65+ }
66+
5767 LogDebugMessage ("Started SuperTokens with debug logging (supertokens.Init called)" )
5868
5969 appInfoJsonString , _ := json .Marshal (config .AppInfo )
You can’t perform that action at this time.
0 commit comments