Skip to content

Commit 2d4fd67

Browse files
committed
fix: fiber example
1 parent be529da commit 2d4fd67

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/with-fiber/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,19 @@ func main() {
119119

120120
// wrapper of the original implementation of verify session to match the required function signature
121121
func verifySession(options *sessmodels.VerifySessionOptions) fiber.Handler {
122+
shouldCallNext := false
122123
return func(c *fiber.Ctx) error {
123124
err := adaptor.HTTPHandlerFunc(session.VerifySession(options, func(rw http.ResponseWriter, r *http.Request) {
124125
c.SetUserContext(r.Context())
126+
shouldCallNext = true
125127
}))(c)
126128
if err != nil {
127129
return err
128130
}
129-
return c.Next()
131+
if shouldCallNext {
132+
return c.Next()
133+
}
134+
return nil
130135
}
131136
}
132137

0 commit comments

Comments
 (0)