@@ -87,6 +87,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) {
8787 antiCsrf = "VIA_TOKEN"
8888 }
8989 err := supertokens .Init (supertokens.TypeInput {
90+ OnSuperTokensAPIError : func (err error , req * http.Request , res http.ResponseWriter ) {
91+ res .Header ().Set ("Content-Type" , "text/html; charset=utf-8" )
92+ res .WriteHeader (500 )
93+ res .Write ([]byte (err .Error ()))
94+ },
9095 Supertokens : & supertokens.ConnectionInfo {
9196 ConnectionURI : "http://localhost:9000" ,
9297 },
@@ -142,6 +147,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) {
142147 antiCsrf = "VIA_TOKEN"
143148 }
144149 err := supertokens .Init (supertokens.TypeInput {
150+ OnSuperTokensAPIError : func (err error , req * http.Request , res http.ResponseWriter ) {
151+ res .Header ().Set ("Content-Type" , "text/html; charset=utf-8" )
152+ res .WriteHeader (500 )
153+ res .Write ([]byte (err .Error ()))
154+ },
145155 Supertokens : & supertokens.ConnectionInfo {
146156 ConnectionURI : "http://localhost:9000" ,
147157 },
@@ -196,6 +206,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) {
196206 antiCsrf = "VIA_TOKEN"
197207 }
198208 err := supertokens .Init (supertokens.TypeInput {
209+ OnSuperTokensAPIError : func (err error , req * http.Request , res http.ResponseWriter ) {
210+ res .Header ().Set ("Content-Type" , "text/html; charset=utf-8" )
211+ res .WriteHeader (500 )
212+ res .Write ([]byte (err .Error ()))
213+ },
199214 Supertokens : & supertokens.ConnectionInfo {
200215 ConnectionURI : "http://localhost:9000" ,
201216 },
@@ -349,8 +364,9 @@ func reinitialiseBackendConfig(w http.ResponseWriter, r *http.Request) {
349364
350365func featureFlag (response http.ResponseWriter , request * http.Request ) {
351366 json .NewEncoder (response ).Encode (map [string ]interface {}{
352- "sessionJwt" : maxVersion (supertokens .VERSION , "0.3.1" ) == supertokens .VERSION && lastEnableJWTSetting ,
353- "v3AccessToken" : maxVersion (supertokens .VERSION , "0.12.0" ) == supertokens .VERSION ,
367+ "sessionJwt" : maxVersion (supertokens .VERSION , "0.3.1" ) == supertokens .VERSION && lastEnableJWTSetting ,
368+ "v3AccessToken" : maxVersion (supertokens .VERSION , "0.12.0" ) == supertokens .VERSION ,
369+ "duplicateCookieHandling" : maxVersion (supertokens .VERSION , "0.19.0" ) == supertokens .VERSION ,
354370 })
355371}
356372
0 commit comments