-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/tma socials #3025
Feat/tma socials #3025
Conversation
# Conflicts: # packages/appkit/src/client.ts
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
♻️ Vite-Size ♻️Size Difference
Current Size
Base Size
|
# Conflicts: # packages/appkit/src/client.ts
const secureSiteDomain = process.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL | ||
? new URL(process.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL).origin | ||
: '' | ||
const secureSiteDomain = 'https://b1a9fa46.secure-appkit-sdk.pages.dev' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to remove this later 🙏
|
||
if (isLoginEmailUsed) { | ||
const { isConnected } = await this.authProvider.isConnected() | ||
if (isConnected) { | ||
await this.setAuthProvider() | ||
} else { | ||
this.appKit?.setLoading(false) | ||
} | ||
this.appKit?.setLoading(isLoginEmailUsed) | ||
} | ||
|
||
const { isConnected } = await this.authProvider.isConnected() | ||
if (isConnected) { | ||
await this.setAuthProvider() | ||
} else if (isLoginEmailUsed) { | ||
this.appKit?.setLoading(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you sure about this? the sync function is triggered on re-connection so I think you do need to check if isLoginEmailUSed
if (isLoginEmailUsed) { | ||
this.appKit?.setLoading(isLoginEmailUsed) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed?? isLoginEmailUsed is already a bool
if (typeof window === 'undefined' || typeof document === 'undefined') { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have HelperUtil.isClient
@@ -629,4 +635,58 @@ export class AppKit { | |||
|
|||
return this.initPromise | |||
} | |||
|
|||
private async checkExistingConnection() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename to something like checkExistingSocialConnection
?
setTimeout(() => { | ||
this.checkExistingConnection() | ||
}, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to trigger this here? shouldn't you do after / during authConnector initialization?
@@ -25,7 +26,8 @@ export const SafeLocalStorageKeys = { | |||
CONNECTED_SOCIAL: '@appkit/connected_social', | |||
CONNECTED_SOCIAL_USERNAME: '@appkit/connected_social_username', | |||
RECENT_WALLETS: '@appkit/recent_wallets', | |||
DEEPLINK_CHOICE: 'WALLETCONNECT_DEEPLINK_CHOICE' | |||
DEEPLINK_CHOICE: 'WALLETCONNECT_DEEPLINK_CHOICE', | |||
SOCIAL_PROVIDER: '@appkit/social_provider' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have CONNECTED_SOCIAL
export const SECURE_SITE_SDK = 'https://b1a9fa46.secure-appkit-sdk.pages.dev/sdk' | ||
// Process.env['NEXT_PUBLIC_SECURE_SITE_SDK_URL'] || 'https://secure.walletconnect.org/sdk' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to remove this 🙏
closing as this is veeery out of date. will link the new PR |
Description
Implemented social login flow that works in telegram mini apps. It uses direct redirects instead of popup window for social login approval.
TODO: remove custom secure site urls before merge. This would also cause the test app linked here to stop working as its using latest vercel deployment of this PR
Type of change
Test app
https://t.me/appkit_test_ggr_bot/appkit
Checklist