You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Printf("[ERROR] Failed finding user %s for support access: %s", user.Username, err)
11510
+
resp.WriteHeader(400)
11511
+
resp.Write([]byte(`{"success": false, "reason": "Failed finding user for support access"}`))
11512
+
return
11513
+
}
11514
+
11515
+
if len(foundUsers) > 1 {
11516
+
log.Printf("[ERROR] Found multiple users for support access user %s", user.Username)
11517
+
}
11518
+
11519
+
newUsers := []User{}
11520
+
for _, loopUser := range foundUsers {
11521
+
if strings.ToLower(strings.TrimSpace(loopUser.Username)) != fileId {
11522
+
continue
11523
+
}
11524
+
11525
+
newUsers = append(newUsers, loopUser)
11526
+
}
11527
+
11528
+
if len(newUsers) == 0 {
11529
+
log.Printf("[WARNING] No user found with username '%s' for support access user %s", fileId, user.Username)
11530
+
resp.WriteHeader(400)
11531
+
resp.Write([]byte(`{"success": false, "reason": "No user found with that username"}`))
11532
+
return
11533
+
}
11534
+
11535
+
foundUsers = newUsers
11536
+
log.Printf("[AUDIT] Support access user %s is trying to swap to org for user %s (%s). Found ID: %s", user.Username, fileId, foundUsers[0].Id, foundUsers[0].ActiveOrg.Id)
11537
+
tmpData.OrgId = foundUsers[0].ActiveOrg.Id
11538
+
fileId = foundUsers[0].ActiveOrg.Id
11539
+
}
11540
+
11505
11541
// Add instantswap of backend
11506
11542
// This could in theory be built out open source as well
0 commit comments