Skip to content

Commit

Permalink
wax. set default expiration for user
Browse files Browse the repository at this point in the history
  • Loading branch information
edospadoni committed Jun 11, 2024
1 parent b369b6d commit 341c4e0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions wax/methods/auth_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,10 @@ func EmailAuth(c *gin.Context) {

// define username
newUsername := email
newValidUntil := time.Now().UTC().AddDate(0, 0, daysInt+1)

// add mac address to username if skip_auth is enabled
if skipVerification.Value == "true" {
newUsername += ":" + mac

// skip_auth accounts are valid for 8 hours
newValidUntil = time.Now().UTC().Add(time.Hour * time.Duration(8))
}

newUser := models.User{
Expand All @@ -344,7 +340,7 @@ func EmailAuth(c *gin.Context) {
MaxNavigationTime: maxTimeInt,
AutoLogin: autoLoginBool,
ValidFrom: time.Now().UTC(),
ValidUntil: newValidUntil,
ValidUntil: time.Now().UTC().AddDate(0, 0, daysInt+1),
}
newUser.Id = methods.CreateUser(newUser)

Expand Down

0 comments on commit 341c4e0

Please sign in to comment.