don't log hashed passwords
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"html"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -50,11 +51,13 @@ func Register(c *gin.Context) {
|
||||
|
||||
// Check if user already exists
|
||||
testUser, _ := models.GetUserByName(u.UserName)
|
||||
log.Printf("Register checking if user already exists : '%v'\n", testUser)
|
||||
log.Printf("Register checking if user '%s' already exists\n", u.UserName)
|
||||
if (models.User{} == testUser) {
|
||||
log.Printf("Register confirmed no existing username\n")
|
||||
} else {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "Attempt to register conflicting username"})
|
||||
err := errors.New("attempt to register conflicting username")
|
||||
log.Printf("Register error : '%s'\n", err)
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -51,7 +51,7 @@ func JwtAuthAdminMiddleware() gin.HandlerFunc {
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
log.Printf("JwtAuthAdminMiddleware retrieved UserRole object '%v'\n", ur)
|
||||
log.Printf("JwtAuthAdminMiddleware retrieved UserRole object for UserId '%d'\n", ur.UserId)
|
||||
|
||||
// Verify that the user has a role with the admin flag set
|
||||
if !ur.Admin {
|
||||
|
Reference in New Issue
Block a user