package handlers import ( "net/http" "github.com/gin-gonic/gin" "github.com/synctv-org/synctv/internal/op" "github.com/synctv-org/synctv/server/model" ) func Me(ctx *gin.Context) { user := ctx.MustGet("user").(*op.User) ctx.JSON(http.StatusOK, model.NewApiDataResp(gin.H{ "username": user.Username, })) } func LogoutUser(ctx *gin.Context) { user := ctx.MustGet("user").(*op.User) err := op.DeleteUserByID(user.ID) if err != nil { ctx.AbortWithStatusJSON(http.StatusInternalServerError, model.NewApiErrorResp(err)) return } ctx.Status(http.StatusNoContent) }