diff --git a/backend/internal/httpapi/router.go b/backend/internal/httpapi/router.go index 48a78a7..d45c936 100644 --- a/backend/internal/httpapi/router.go +++ b/backend/internal/httpapi/router.go @@ -12,6 +12,7 @@ type Handlers struct { User *handler.UserHandler Chat *handler.ChatHandler Message *handler.MessageHandler + Auth *handler.AuthHandler } func NewRouter(h Handlers, auth gin.HandlerFunc) *gin.Engine { @@ -28,11 +29,14 @@ func NewRouter(h Handlers, auth gin.HandlerFunc) *gin.Engine { api := r.Group("/api/v1") { api.POST("/users", h.User.Create) + api.POST("/auth/sessions", h.Auth.CreateSession) } protected := api.Group("") protected.Use(auth) { + protected.DELETE("/auth/sessions/current", h.Auth.RevokeCurrent) + protected.GET("/users/me", h.User.Current) protected.POST("/chats", h.Chat.Create) protected.GET("/chats", h.Chat.List)