@@ -87,6 +87,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) {
87
87
antiCsrf = "VIA_TOKEN"
88
88
}
89
89
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
+ },
90
95
Supertokens : & supertokens.ConnectionInfo {
91
96
ConnectionURI : "http://localhost:9000" ,
92
97
},
@@ -142,6 +147,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) {
142
147
antiCsrf = "VIA_TOKEN"
143
148
}
144
149
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
+ },
145
155
Supertokens : & supertokens.ConnectionInfo {
146
156
ConnectionURI : "http://localhost:9000" ,
147
157
},
@@ -196,6 +206,11 @@ func callSTInit(enableAntiCsrf bool, enableJWT bool, jwtPropertyName string) {
196
206
antiCsrf = "VIA_TOKEN"
197
207
}
198
208
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
+ },
199
214
Supertokens : & supertokens.ConnectionInfo {
200
215
ConnectionURI : "http://localhost:9000" ,
201
216
},
@@ -349,8 +364,9 @@ func reinitialiseBackendConfig(w http.ResponseWriter, r *http.Request) {
349
364
350
365
func featureFlag (response http.ResponseWriter , request * http.Request ) {
351
366
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 ,
354
370
})
355
371
}
356
372
0 commit comments