register LoadAuthContext as Pre so that the auth context is aavailable other Pre middlewares

This commit is contained in:
Gani Georgiev 2023-07-25 12:45:41 +03:00
parent 54a6ae6710
commit c3f7aeb856
1 changed files with 1 additions and 1 deletions

View File

@ -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) {