aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/user/profile.go
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-12 02:52:22 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-12 02:53:52 +0300
commitd05ea66f4bbcf0cc5c8908f3435c68de1b070fa1 (patch)
tree7c7a769206646f2b81a0eda0680f0be5033a4197 /pkg/handler/user/profile.go
Начальная версияv0.0.1
Diffstat (limited to 'pkg/handler/user/profile.go')
-rw-r--r--pkg/handler/user/profile.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/handler/user/profile.go b/pkg/handler/user/profile.go
new file mode 100644
index 0000000..7181ca7
--- /dev/null
+++ b/pkg/handler/user/profile.go
@@ -0,0 +1,16 @@
+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())
+}