Skip to content

Commit

Permalink
fix: the with-labstack-echo example
Browse files Browse the repository at this point in the history
  • Loading branch information
furkansenharputlu committed May 1, 2024
1 parent b827deb commit 39ce770
Showing 1 changed file with 9 additions and 2 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

0 comments on commit 39ce770

Please sign in to comment.