Skip to content

Commit

Permalink
Merge branch '0.18' into cookie-domain-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anku255 authored May 2, 2024
2 parents d4f7b4a + 0ca19ca commit af3e211
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 9 additions & 2 deletions examples/with-labstack-echo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package main
import (
"encoding/json"
"errors"
"github.com/supertokens/supertokens-golang/recipe/dashboard"
"net/http"
"strings"

"github.com/supertokens/supertokens-golang/recipe/dashboard"

"github.com/labstack/echo/v4"
"github.com/supertokens/supertokens-golang/recipe/emailverification"
"github.com/supertokens/supertokens-golang/recipe/emailverification/evmodels"
Expand Down Expand Up @@ -200,8 +201,14 @@ func verifySession(options *sessmodels.VerifySessionOptions) echo.MiddlewareFunc
return func(c echo.Context) error {
session.VerifySession(options, func(rw http.ResponseWriter, r *http.Request) {
c.Set("session", session.GetSessionFromRequestContext(r.Context()))
hf(c)

// Call the handler
err := hf(c)
if err != nil {
c.Error(err)
}
})(c.Response(), c.Request())

return nil
}
}
Expand Down
7 changes: 1 addition & 6 deletions recipe/thirdpartypasswordless/signoutFeature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,7 @@ func TestCallingAPIWithoutSessionShouldReturnOk(t *testing.T) {
if err != nil {
t.Error(err.Error())
}
assert.Equal(t, http.StatusOK, resp.StatusCode)
assert.Equal(t, 0, len(resp.Cookies()))
assert.Equal(t, "", resp.Header.Get("set-cookie"))

response := *unittesting.HttpResponseToConsumableInformation(resp.Body)
assert.Equal(t, "OK", response["status"])
assert.Equal(t, 401, resp.StatusCode)
}

func TestThatSignoutAPIreturnsTryRefreshTokenRefreshSessionAndSignoutShouldReturnOk(t *testing.T) {
Expand Down

0 comments on commit af3e211

Please sign in to comment.