diff --git a/controllers/authController.go b/controllers/authController.go index 68c8e24..3b79b75 100644 --- a/controllers/authController.go +++ b/controllers/authController.go @@ -83,7 +83,7 @@ func Login(c *gin.Context) { } var user models.User - result := initializers.DB.Preload("Posts.Files").First(&user, "email = ?", body.Email) + result := initializers.DB.Preload("Avatar").Preload("Posts.Files").First(&user, "email = ?", body.Email) if result.Error != nil { if errors.Is(result.Error, gorm.ErrRecordNotFound) {