Skip to content

Commit

Permalink
PKG -- [fcl] Respect service method for discovery
Browse files Browse the repository at this point in the history
Addresses: #1374
  • Loading branch information
chasefleming committed Aug 23, 2022
1 parent eca0d7c commit 88686f6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/fcl/src/discovery/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ export const makeDiscoveryServices = async () => {
return [...extensionServices, ...serviceRegistry.getServices()]
}

// Certain method types cannot be overridden to use other methods like POP/RCP
const isServiceMethodUnchangable = method =>
["EXT/RPC", "WC/RPC"].includes(method)

export async function getDiscoveryService(service) {
const discoveryAuthnInclude = await config.get("discovery.authn.include", [])
const discoveryWalletMethod = await config.first([
"discovery.wallet.method",
"discovery.wallet.method.default",
])
const method = isServiceMethodUnchangable(service?.method)
const method = service?.method
? service.method
: discoveryWalletMethod || service.method
: discoveryWalletMethod
const endpoint =
service?.endpoint ??
(await config.first(["discovery.wallet", "challenge.handshake"]))
Expand Down

0 comments on commit 88686f6

Please sign in to comment.