fixed
This commit is contained in:
@@ -105,13 +105,18 @@ func GetUserAttributes(userID string) (map[string]string, error) {
|
|||||||
|
|
||||||
attributes := make(map[string]string)
|
attributes := make(map[string]string)
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var name, value string
|
var name string
|
||||||
|
var value *string
|
||||||
err := rows.Scan(&name, &value)
|
err := rows.Scan(&name, &value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[Repository] ✗ Error scanning user attribute: %v", err)
|
log.Printf("[Repository] ✗ Error scanning user attribute: %v", err)
|
||||||
return nil, fmt.Errorf("error scanning user attribute: %w", err)
|
return nil, fmt.Errorf("error scanning user attribute: %w", err)
|
||||||
}
|
}
|
||||||
attributes[name] = value
|
if value != nil {
|
||||||
|
attributes[name] = *value
|
||||||
|
} else {
|
||||||
|
attributes[name] = ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[Repository] ✓ Retrieved %d user attributes", len(attributes))
|
log.Printf("[Repository] ✓ Retrieved %d user attributes", len(attributes))
|
||||||
|
|||||||
Reference in New Issue
Block a user