File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88## [ unreleased]
99
1010- Handle AWS Public URLs (ending with ` .amazonaws.com ` ) separately while extracting TLDs for SameSite attribute.
11+ - Return ` 500 ` status instead of panic when ` supertokens.Middleware ` is used without initializing the SDK.
1112
1213## [ 0.14.0] - 2023-09-11
1314
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ func Init(config TypeInput) error {
3434func Middleware (theirHandler http.Handler ) http.Handler {
3535 instance , err := GetInstanceOrThrowError ()
3636 if err != nil {
37- panic ("Please call supertokens.Init function before using the Middleware" )
37+ return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
38+ http .Error (w , err .Error (), http .StatusInternalServerError )
39+ })
3840 }
3941 return instance .middleware (theirHandler )
4042}
You can’t perform that action at this time.
0 commit comments