package rest import ( "net/http" "gitea.dwysokinski.me/twhelp/sessions/internal/router/rest/internal/model" ) type userHandler struct { } // @ID getCurrentUser // @Summary Get the authenticated user // @Description Get the authenticated user // @Tags users // @Produce json // @Success 200 {object} model.GetUserResp // @Failure 401 {object} model.ErrorResp // @Failure 500 {object} model.ErrorResp // @Security ApiKeyAuth // @Router /user [get] func (h *userHandler) getCurrent(w http.ResponseWriter, r *http.Request) { u, _ := userFromContext(r.Context()) renderJSON(w, http.StatusOK, model.NewGetUserResp(u)) }