Skip to content

Commit

Permalink
Merge branch 'master' into go-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
derconno committed Aug 12, 2024
2 parents d90607f + 252bda9 commit 5955c66
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions users/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,24 @@ func GetUserForNFCToken(ctx context.Context, token []byte, db *sql.DB) (User, er

func GetUsernamesWithNoneAuth(ctx context.Context, db *sql.DB) ([]string, error) {
result, err := db.QueryContext(ctx, `SELECT user_id FROM auth WHERE type = 'none'`)
defer result.Close()
if err != nil {
return nil, err
}
names := make([]string, 0)
userIds := make([]string, 0)
for result.Next() {
var userId string
err = result.Scan(&userId)
if err != nil {
continue
}
userIds = append(userIds, userId)
}
err = result.Close()
if err != nil {
return nil, err
}
names := make([]string, 0)
for _, userId := range userIds {
user, err := GetUserForId(ctx, userId, db)
if err != nil {
continue
Expand Down

0 comments on commit 5955c66

Please sign in to comment.