From 4c98e692706b1d15dfe1327830c2f09625f1e3eb Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Wed, 8 May 2024 22:23:33 +0530 Subject: [PATCH] fixes for e2e tests --- test/frontendIntegration/main.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/frontendIntegration/main.go b/test/frontendIntegration/main.go index f8db483a..40a1575f 100644 --- a/test/frontendIntegration/main.go +++ b/test/frontendIntegration/main.go @@ -87,6 +87,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) { antiCsrf = "VIA_TOKEN" } err := supertokens.Init(supertokens.TypeInput{ + OnSuperTokensAPIError: func(err error, req *http.Request, res http.ResponseWriter) { + res.Header().Set("Content-Type", "text/html; charset=utf-8") + res.WriteHeader(500) + res.Write([]byte(err.Error())) + }, Supertokens: &supertokens.ConnectionInfo{ ConnectionURI: "http://localhost:9000", }, @@ -142,6 +147,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) { antiCsrf = "VIA_TOKEN" } err := supertokens.Init(supertokens.TypeInput{ + OnSuperTokensAPIError: func(err error, req *http.Request, res http.ResponseWriter) { + res.Header().Set("Content-Type", "text/html; charset=utf-8") + res.WriteHeader(500) + res.Write([]byte(err.Error())) + }, Supertokens: &supertokens.ConnectionInfo{ ConnectionURI: "http://localhost:9000", }, @@ -196,6 +206,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) { antiCsrf = "VIA_TOKEN" } err := supertokens.Init(supertokens.TypeInput{ + OnSuperTokensAPIError: func(err error, req *http.Request, res http.ResponseWriter) { + res.Header().Set("Content-Type", "text/html; charset=utf-8") + res.WriteHeader(500) + res.Write([]byte(err.Error())) + }, Supertokens: &supertokens.ConnectionInfo{ ConnectionURI: "http://localhost:9000", }, @@ -349,8 +364,9 @@ func reinitialiseBackendConfig(w http.ResponseWriter, r *http.Request) { func featureFlag(response http.ResponseWriter, request *http.Request) { json.NewEncoder(response).Encode(map[string]interface{}{ - "sessionJwt": maxVersion(supertokens.VERSION, "0.3.1") == supertokens.VERSION && lastEnableJWTSetting, - "v3AccessToken": maxVersion(supertokens.VERSION, "0.12.0") == supertokens.VERSION, + "sessionJwt": maxVersion(supertokens.VERSION, "0.3.1") == supertokens.VERSION && lastEnableJWTSetting, + "v3AccessToken": maxVersion(supertokens.VERSION, "0.12.0") == supertokens.VERSION, + "duplicateCookieHandling": maxVersion(supertokens.VERSION, "0.19.0") == supertokens.VERSION, }) }