@@ -99,7 +99,11 @@ export type Web3NonCustodialProviderParams = {
9999 googleOauth2ClientId : string ;
100100 twitterOauth2ClientId : string ;
101101 discordOauth2ClientId : string ;
102- appleOauth2ClientId : string ;
102+ /**
103+ * @deprecated Apple Sign In was removed. Omit this field. If a non-empty value is passed,
104+ * the constructor throws so misconfiguration is visible immediately instead of failing later.
105+ */
106+ appleOauth2ClientId ?: string ;
103107} ;
104108
105109export type Web3NonCustodialProviderUser = {
@@ -178,9 +182,13 @@ export class Web3NonCustodialProvider {
178182 googleOauth2ClientId : string ;
179183 twitterOauth2ClientId : string ;
180184 discordOauth2ClientId : string ;
181- appleOauth2ClientId : string ;
182185
183186 constructor ( params : Web3NonCustodialProviderParams ) {
187+ if ( params . appleOauth2ClientId ) {
188+ throw new Error (
189+ "Apple Sign no longer supported in SDK." ,
190+ ) ;
191+ }
184192 this . projectId = params . projectId ;
185193 this . appOrigin = params . appOrigin ? params . appOrigin : "https://utxos.dev" ;
186194 this . storageLocation = params . storageLocation
@@ -189,7 +197,6 @@ export class Web3NonCustodialProvider {
189197 this . googleOauth2ClientId = params . googleOauth2ClientId ;
190198 this . twitterOauth2ClientId = params . twitterOauth2ClientId ;
191199 this . discordOauth2ClientId = params . discordOauth2ClientId ;
192- this . appleOauth2ClientId = params . appleOauth2ClientId ;
193200 }
194201
195202 private base64Encode ( str : string ) : string {
@@ -479,6 +486,11 @@ export class Web3NonCustodialProvider {
479486 redirectUrl : string ,
480487 callback : ( authorizationUrl : string ) => void ,
481488 ) {
489+ if ( provider === "apple" ) {
490+ throw new Error (
491+ "Apple Sign In was removed. Use google, discord, twitter, or email." ,
492+ ) ;
493+ }
482494 if ( provider === "google" ) {
483495 const googleState = JSON . stringify ( {
484496 redirect : redirectUrl ,
@@ -536,25 +548,6 @@ export class Web3NonCustodialProvider {
536548 "https://x.com/i/oauth2/authorize?" + twitterSearchParams . toString ( ) ;
537549 callback ( twitterAuthorizeUrl ) ;
538550 return ;
539- } else if ( provider === "apple" ) {
540- const appleState = JSON . stringify ( {
541- redirect : redirectUrl ,
542- provider : "apple" ,
543- projectId : this . projectId ,
544- } ) ;
545- const appleSearchParams = new URLSearchParams ( {
546- client_id : this . appleOauth2ClientId ,
547- response_type : "code" ,
548- redirect_uri : this . appOrigin + "/api/auth" ,
549- response_mode : "form_post" ,
550- scope : "name email" ,
551- state : this . base64Encode ( appleState ) ,
552- } ) ;
553- const appleAuthorizeUrl =
554- "https://appleid.apple.com/auth/authorize?" +
555- appleSearchParams . toString ( ) ;
556- callback ( appleAuthorizeUrl ) ;
557- return ;
558551 } else if ( provider === "email" ) {
559552 // Email uses OTP flow, not OAuth - this method should not be called for email
560553 throw new Error ( "Email provider uses OTP flow. Use the email OTP API endpoints instead." ) ;
0 commit comments