File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
packages/auth/src/providers/cognito/apis Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -130,8 +130,10 @@ const oauthSignIn = async ({
130130 params . append ( 'code_challenge' , toCodeChallenge ( ) ) ;
131131 params . append ( 'code_challenge_method' , method ) ;
132132 }
133- const oAuthUrl = new URL ( '/oauth2/authorize' , `https://${ domain } /` ) ;
134- oAuthUrl . search = params . toString ( ) ;
133+
134+ // Using URL object is not supported in React Native as the `search` property is read-only
135+ // See: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Blob/URL.js
136+ const oAuthUrl = `https://${ domain } /oauth2/authorize?${ params . toString ( ) } ` ;
135137
136138 // this will only take effect in the following scenarios:
137139 // 1. the user cancels the OAuth flow on web via back button, and
@@ -140,11 +142,8 @@ const oauthSignIn = async ({
140142
141143 // the following is effective only in react-native as openAuthSession resolves only in react-native
142144 const { type, error, url } =
143- ( await openAuthSession (
144- oAuthUrl . href ,
145- redirectSignIn ,
146- preferPrivateSession ,
147- ) ) ?? { } ;
145+ ( await openAuthSession ( oAuthUrl , redirectSignIn , preferPrivateSession ) ) ??
146+ { } ;
148147
149148 try {
150149 if ( type === 'error' ) {
You can’t perform that action at this time.
0 commit comments