mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-24 23:10:24 +02:00
register LoadAuthContext as Pre so that the auth context is aavailable other Pre middlewares
This commit is contained in:
1 parent
54a6ae6710
commit
c3f7aeb856
1 file changed
+1
-1
+1
-1
@@ -46,9 +46,9 @@ func InitApi(app core.App) (*echo.Echo, error) {
|
|||||||
return !strings.HasPrefix(c.Request().URL.Path, "/api/")
|
return !strings.HasPrefix(c.Request().URL.Path, "/api/")
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
e.Pre(LoadAuthContext(app))
|
||||||
e.Use(middleware.Recover())
|
e.Use(middleware.Recover())
|
||||||
e.Use(middleware.Secure())
|
e.Use(middleware.Secure())
|
||||||
e.Use(LoadAuthContext(app))
|
|
||||||
|
|
||||||
// custom error handler
|
// custom error handler
|
||||||
e.HTTPErrorHandler = func(c echo.Context, err error) {
|
e.HTTPErrorHandler = func(c echo.Context, err error) {
|
||||||
|
|||||||
Reference in new issue
Block a user