Skip to content

Commit

Permalink
Managed users fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
aunefyren committed Nov 28, 2023
1 parent 8072003 commit 03364f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions routes/both.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,17 @@ func ApiWrapperGetStatistics(context *gin.Context) {
userActive = wrapperrUser.Active
}

// If no username and no user_id has been declared at this point, something is wrong. Return error.
if userName == "" || userEmail == "" || userId == 0 {
// If no username, email and no user_id has been declared at this point, and Plex Auth is active, something is wrong. Return error.
if (userName == "" || userEmail == "" || userId == 0) && config.PlexAuth {
log.Println("At this point the user should have been verified, but username, email or ID is empty.")
context.JSON(http.StatusInternalServerError, gin.H{"error": "User validation error."})
context.Abort()
return
} else if userName == "" || userEmail == "" {
log.Println("At this point the user should have been verified, but username or ID is empty.")
context.JSON(http.StatusInternalServerError, gin.H{"error": "User validation error."})
context.Abort()
return
}

if !userActive {
Expand Down

0 comments on commit 03364f0

Please sign in to comment.