diff --git a/controller/user.go b/controller/user.go index af90acf6..ac63623a 100644 --- a/controller/user.go +++ b/controller/user.go @@ -173,6 +173,18 @@ func Register(c *gin.Context) { }) return } + user.ValidateAndFill() + cleanToken := model.Token{ + UserId: user.Id, + Name: "default", + Key: random.GenerateKey(), + CreatedTime: 0, + AccessedTime: 0, + ExpiredTime: -1, + RemainQuota: -1, + UnlimitedQuota: true, + } + cleanToken.Insert() c.JSON(http.StatusOK, gin.H{ "success": true, "message": "",