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