framework/pkg/handler/user/profile.go

17 lines
336 B
Go
Raw Normal View History

2024-10-12 02:52:22 +03:00
package user
import (
"github.com/labstack/echo/v4"
"go.neonxp.ru/framework/pkg/tpl"
"go.neonxp.ru/framework/pkg/utils"
)
func (*Handler) Profile(c echo.Context) error {
u := utils.GetUserCtx(c.Request().Context())
if u == nil {
return echo.ErrForbidden
}
return tpl.Profile(u).Render(c.Request().Context(), c.Response())
}