Skip to content

Commit

Permalink
check for a clientId match before using the regex
Browse files Browse the repository at this point in the history
  • Loading branch information
colintremblay-okta authored and mikenachbaur-okta committed Feb 7, 2024
1 parent f1895cc commit 3bd2fbe
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ extension SDKVersion.Migration {
let results = items.filter({ searchResult in
// swiftlint:disable empty_string
guard searchResult.service == "",
regex.matches(in: searchResult.account, range: NSRange(location: 0, length: searchResult.account.count)).count == 1
clientId == searchResult.account ||
regex.matches(in: searchResult.account, range: NSRange(location: 0, length: searchResult.account.count)).count == 1
else {
return false
}
Expand All @@ -115,8 +116,9 @@ extension SDKVersion.Migration {
.Search(service: "")
.list()
.filter({ searchResult in
regex.matches(in: searchResult.account,
range: NSRange(location: 0, length: searchResult.account.count)).count == 1
clientId == searchResult.account ||
regex.matches(in: searchResult.account,
range: NSRange(location: 0, length: searchResult.account.count)).count == 1
}).map({ searchResult in
let item = try searchResult.get()
return (searchResult, try decode(item.value))
Expand Down

0 comments on commit 3bd2fbe

Please sign in to comment.