@@ -104,7 +104,11 @@ export type Web3NonCustodialProviderParams = {
104104 googleOauth2ClientId : string ;
105105 twitterOauth2ClientId : string ;
106106 discordOauth2ClientId : string ;
107- appleOauth2ClientId : string ;
107+ /**
108+ * @deprecated Apple Sign In was removed. Omit this field. If a non-empty value is passed,
109+ * the constructor throws so misconfiguration is visible immediately instead of failing later.
110+ */
111+ appleOauth2ClientId ?: string ;
108112} ;
109113
110114export type Web3NonCustodialProviderUser = {
@@ -183,9 +187,13 @@ export class Web3NonCustodialProvider {
183187 googleOauth2ClientId : string ;
184188 twitterOauth2ClientId : string ;
185189 discordOauth2ClientId : string ;
186- appleOauth2ClientId : string ;
187190
188191 constructor ( params : Web3NonCustodialProviderParams ) {
192+ if ( params . appleOauth2ClientId ) {
193+ throw new Error (
194+ "Apple Sign no longer supported in SDK." ,
195+ ) ;
196+ }
189197 this . projectId = params . projectId ;
190198 this . appOrigin = params . appOrigin ? params . appOrigin : "https://utxos.dev" ;
191199 this . storageLocation = params . storageLocation
@@ -194,7 +202,6 @@ export class Web3NonCustodialProvider {
194202 this . googleOauth2ClientId = params . googleOauth2ClientId ;
195203 this . twitterOauth2ClientId = params . twitterOauth2ClientId ;
196204 this . discordOauth2ClientId = params . discordOauth2ClientId ;
197- this . appleOauth2ClientId = params . appleOauth2ClientId ;
198205 }
199206
200207 private base64Encode ( str : string ) : string {
@@ -492,6 +499,11 @@ export class Web3NonCustodialProvider {
492499 redirectUrl : string ,
493500 callback : ( authorizationUrl : string ) => void ,
494501 ) {
502+ if ( ( provider as string ) === "apple" ) {
503+ throw new Error (
504+ "Apple Sign In was removed. Use google, discord, twitter, or email." ,
505+ ) ;
506+ }
495507 if ( provider === "google" ) {
496508 const googleState = JSON . stringify ( {
497509 redirect : redirectUrl ,
@@ -549,25 +561,6 @@ export class Web3NonCustodialProvider {
549561 "https://x.com/i/oauth2/authorize?" + twitterSearchParams . toString ( ) ;
550562 callback ( twitterAuthorizeUrl ) ;
551563 return ;
552- } else if ( provider === "apple" ) {
553- const appleState = JSON . stringify ( {
554- redirect : redirectUrl ,
555- provider : "apple" ,
556- projectId : this . projectId ,
557- } ) ;
558- const appleSearchParams = new URLSearchParams ( {
559- client_id : this . appleOauth2ClientId ,
560- response_type : "code" ,
561- redirect_uri : this . appOrigin + "/api/auth" ,
562- response_mode : "form_post" ,
563- scope : "name email" ,
564- state : this . base64Encode ( appleState ) ,
565- } ) ;
566- const appleAuthorizeUrl =
567- "https://appleid.apple.com/auth/authorize?" +
568- appleSearchParams . toString ( ) ;
569- callback ( appleAuthorizeUrl ) ;
570- return ;
571564 } else if ( provider === "email" ) {
572565 // Email uses OTP flow, not OAuth - this method should not be called for email
573566 throw new Error ( "Email provider uses OTP flow. Use the email OTP API endpoints instead." ) ;
0 commit comments