2022-05-01 16:07:53 +02:00

19 lines
285 B
Go

package api
import (
"net/http"
"github.com/gin-gonic/gin"
)
func (s *Service) Me(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"status": "success",
"user": s.CurrentSession(c).Account.Login,
})
}
func (s *Service) MeInit() {
s.Gin.GET("/me", s.RequireSession, s.Me)
}