/profile works for admins as well which was designed for non-admins role users only. A known bug that was caused due to using admin role for the auth context in handlers/auth.go
case "admin":
var profile models.Admin
result := h.DB.Where("email = ?", email).Take(&profile)
if result.Error != nil {
c.JSON(500, gin.H{"error": "failed to fetch user profile"})
return
}
// hand-pick the fields so the password hash never leaves the server
userProfile = gin.H{
"id": profile.ID,
"email": profile.Email,
"position": profile.Position,
"is_verified": profile.IsVerified,
"created_at": profile.CreatedAt,
}
/profile works for admins as well which was designed for non-admins role users only. A known bug that was caused due to using admin role for the auth context in
handlers/auth.go