From c3f7aeb85648522b7dc3b6898632678ce43c207f Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Tue, 25 Jul 2023 12:45:41 +0300 Subject: [PATCH] register LoadAuthContext as Pre so that the auth context is aavailable other Pre middlewares --- apis/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/base.go b/apis/base.go index 292af347..8d6f4d67 100644 --- a/apis/base.go +++ b/apis/base.go @@ -46,9 +46,9 @@ func InitApi(app core.App) (*echo.Echo, error) { return !strings.HasPrefix(c.Request().URL.Path, "/api/") }, })) + e.Pre(LoadAuthContext(app)) e.Use(middleware.Recover()) e.Use(middleware.Secure()) - e.Use(LoadAuthContext(app)) // custom error handler e.HTTPErrorHandler = func(c echo.Context, err error) {