File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
examples/with-labstack-echo
recipe/thirdpartypasswordless Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,11 @@ package main
3
3
import (
4
4
"encoding/json"
5
5
"errors"
6
- "github.com/supertokens/supertokens-golang/recipe/dashboard"
7
6
"net/http"
8
7
"strings"
9
8
9
+ "github.com/supertokens/supertokens-golang/recipe/dashboard"
10
+
10
11
"github.com/labstack/echo/v4"
11
12
"github.com/supertokens/supertokens-golang/recipe/emailverification"
12
13
"github.com/supertokens/supertokens-golang/recipe/emailverification/evmodels"
@@ -200,8 +201,14 @@ func verifySession(options *sessmodels.VerifySessionOptions) echo.MiddlewareFunc
200
201
return func (c echo.Context ) error {
201
202
session .VerifySession (options , func (rw http.ResponseWriter , r * http.Request ) {
202
203
c .Set ("session" , session .GetSessionFromRequestContext (r .Context ()))
203
- hf (c )
204
+
205
+ // Call the handler
206
+ err := hf (c )
207
+ if err != nil {
208
+ c .Error (err )
209
+ }
204
210
})(c .Response (), c .Request ())
211
+
205
212
return nil
206
213
}
207
214
}
Original file line number Diff line number Diff line change @@ -280,12 +280,7 @@ func TestCallingAPIWithoutSessionShouldReturnOk(t *testing.T) {
280
280
if err != nil {
281
281
t .Error (err .Error ())
282
282
}
283
- assert .Equal (t , http .StatusOK , resp .StatusCode )
284
- assert .Equal (t , 0 , len (resp .Cookies ()))
285
- assert .Equal (t , "" , resp .Header .Get ("set-cookie" ))
286
-
287
- response := * unittesting .HttpResponseToConsumableInformation (resp .Body )
288
- assert .Equal (t , "OK" , response ["status" ])
283
+ assert .Equal (t , 401 , resp .StatusCode )
289
284
}
290
285
291
286
func TestThatSignoutAPIreturnsTryRefreshTokenRefreshSessionAndSignoutShouldReturnOk (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments