File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/thirdweb/src/utils Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export function getClientFetch(client: ThirdwebClient, ecosystem?: Ecosystem) {
4747
4848 // if we have an auth token set, use that (thirdweb.com/dashboard sets this for the user)
4949 // pay urls should never send the auth token, because we always want the "developer" to be the one making the request, not the "end user"
50- if ( authToken && ! isPayUrl ( url ) ) {
50+ if ( authToken && ! isPayUrl ( url ) && ! isInAppWalletUrl ( url ) ) {
5151 headers . set ( "authorization" , `Bearer ${ authToken } ` ) ;
5252 } else if ( secretKey ) {
5353 headers . set ( "x-secret-key" , secretKey ) ;
@@ -140,6 +140,19 @@ function isPayUrl(url: string): boolean {
140140 }
141141}
142142
143+ function isInAppWalletUrl ( url : string ) : boolean {
144+ try {
145+ const { hostname } = new URL ( url ) ;
146+ // pay service hostname always starts with "pay."
147+ return (
148+ hostname . startsWith ( "in-app-wallet." ) ||
149+ hostname . startsWith ( "embedded-wallet." )
150+ ) ;
151+ } catch {
152+ return false ;
153+ }
154+ }
155+
143156const SDK_NAME = "unified-sdk" ;
144157
145158let previousPlatform : [ string , string ] [ ] | undefined ;
You can’t perform that action at this time.
0 commit comments