diff --git a/packages/@magic-ext/oauth2/src/index.ts b/packages/@magic-ext/oauth2/src/index.ts index 3c766eac..6fc9b972 100644 --- a/packages/@magic-ext/oauth2/src/index.ts +++ b/packages/@magic-ext/oauth2/src/index.ts @@ -63,7 +63,7 @@ export class OAuthExtension extends Extension.Internal<'oauth2'> { new URL(successResult.oauthAuthoriationURI, this.sdk.endpoint).href : successResult.oauthAuthoriationURI; - if (configuration?.shouldReturnURI) { + if (successResult?.shouldReturnURI) { resolve(redirectURI); } else { window.location.href = redirectURI; @@ -120,8 +120,8 @@ export class OAuthExtension extends Extension.Internal<'oauth2'> { console.log('Error while verifying telegram data', verificationError); } } - } catch (seamlessLoginError) { - console.log('Error while loading telegram-web-app script', seamlessLoginError); + } catch (seamlessLoginError) { + console.log('Error while loading telegram-web-app script', seamlessLoginError); } } } diff --git a/packages/@magic-ext/oauth2/src/types.ts b/packages/@magic-ext/oauth2/src/types.ts index 7437442e..7bf18fa6 100644 --- a/packages/@magic-ext/oauth2/src/types.ts +++ b/packages/@magic-ext/oauth2/src/types.ts @@ -73,6 +73,7 @@ export type OpenIDConnectUserInfo = OpenIDConnectProfile & export interface OAuthRedirectStartResult { oauthAuthoriationURI?: string; useMagicServerCallback?: boolean; + shouldReturnURI?: boolean; } export interface OAuthRedirectResult { @@ -101,7 +102,6 @@ export interface OAuthRedirectConfiguration { scope?: string[]; customData?: string; loginHint?: string; - shouldReturnURI?: boolean; } export interface OAuthPopupConfiguration {