aboutsummaryrefslogtreecommitdiffstats
path: root/backend/internal/api/v1/users
diff options
context:
space:
mode:
Diffstat (limited to 'backend/internal/api/v1/users')
-rw-r--r--backend/internal/api/v1/users/handler.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/backend/internal/api/v1/users/handler.go b/backend/internal/api/v1/users/handler.go
new file mode 100644
index 0000000..9e53147
--- /dev/null
+++ b/backend/internal/api/v1/users/handler.go
@@ -0,0 +1,19 @@
+package users
+
+import (
+ "net/http"
+
+ "github.com/gin-gonic/gin"
+)
+
+// GetCurrentUser returns the authenticated user's information
+func GetCurrentUser(c *gin.Context) {
+ // Get user from context (set by auth middleware)
+ user, exists := c.Get("user")
+ if !exists {
+ c.JSON(http.StatusNotFound, gin.H{"error": "User not found"})
+ return
+ }
+
+ c.JSON(http.StatusOK, gin.H{"user": user})
+}