func (h *Handler) GetProfile(c echo.Context) (err error) {
	userID := userIDFromToken(c)

	// Retrieve posts from database
	user := model.User{}
	db := h.DB.Clone()

	if err = db.DB(config.DbName).C("users").FindId(bson.ObjectIdHex(userID)).One(&user); err != nil {
		return
	}

	defer db.Close()

	user.Password = ""

	return c.JSON(http.StatusOK, user)
}
// GetProfile to profile of the user
GetProfile to profile of the user
// GetProfile to profile of the user
func (h *Handler) GetProfile(c echo.Context) (err error) {
	userID := userIDFromToken(c)
	user := model.User{}
	db := h.DB.Clone()
	if err = db.DB(config.DbName).C("users").FindId(bson.ObjectIdHex(userID)).One(&user); err != nil {
		return
	}
	defer db.Close()
	user.Password = ""
	return c.JSON(http.StatusOK, user)
}
func ( h * Handler ) GetProfile ( c echo . Context ) ( err error ) { userID := userIDFromToken ( c ) user := model . User { } db := h . DB . Clone ( ) if err = db . DB ( config . DbName ) . C ( " " ) . FindId ( bson . ObjectIdHex ( userID ) ) . One ( & user ) ; err != nil { return } defer db . Close ( ) user . Password = " " return c . JSON ( http . StatusOK , user ) }
GetProfile to profile of the user
GetProfile to profile of the user
// Retrieve posts from database