Skip to content

Commit af3e211

Browse files
authored
Merge branch '0.18' into cookie-domain-fix
2 parents d4f7b4a + 0ca19ca commit af3e211

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

examples/with-labstack-echo/main.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package main
33
import (
44
"encoding/json"
55
"errors"
6-
"github.com/supertokens/supertokens-golang/recipe/dashboard"
76
"net/http"
87
"strings"
98

9+
"github.com/supertokens/supertokens-golang/recipe/dashboard"
10+
1011
"github.com/labstack/echo/v4"
1112
"github.com/supertokens/supertokens-golang/recipe/emailverification"
1213
"github.com/supertokens/supertokens-golang/recipe/emailverification/evmodels"
@@ -200,8 +201,14 @@ func verifySession(options *sessmodels.VerifySessionOptions) echo.MiddlewareFunc
200201
return func(c echo.Context) error {
201202
session.VerifySession(options, func(rw http.ResponseWriter, r *http.Request) {
202203
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+
}
204210
})(c.Response(), c.Request())
211+
205212
return nil
206213
}
207214
}

recipe/thirdpartypasswordless/signoutFeature_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,7 @@ func TestCallingAPIWithoutSessionShouldReturnOk(t *testing.T) {
280280
if err != nil {
281281
t.Error(err.Error())
282282
}
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)
289284
}
290285

291286
func TestThatSignoutAPIreturnsTryRefreshTokenRefreshSessionAndSignoutShouldReturnOk(t *testing.T) {

0 commit comments

Comments
 (0)