mirror of
https://github.com/aunefyren/wrapperr
synced 2025-01-08 15:58:43 +00:00
Managed users fixed
This commit is contained in:
parent
80720039e8
commit
03364f040b
1 changed files with 7 additions and 2 deletions
|
@ -281,12 +281,17 @@ func ApiWrapperGetStatistics(context *gin.Context) {
|
||||||
userActive = wrapperrUser.Active
|
userActive = wrapperrUser.Active
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no username and no user_id has been declared at this point, something is wrong. Return error.
|
// 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 {
|
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.")
|
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.JSON(http.StatusInternalServerError, gin.H{"error": "User validation error."})
|
||||||
context.Abort()
|
context.Abort()
|
||||||
return
|
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 {
|
if !userActive {
|
||||||
|
|
Loading…
Reference in a new issue