Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
enable privy wallet login
Browse files Browse the repository at this point in the history
  • Loading branch information
intergalacticspacehighway committed Nov 23, 2023
1 parent 293b316 commit f1731b0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion packages/app/components/header/header.md.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,12 @@ export const HeaderMd = withColorScheme(() => {
<Button
size="regular"
tw="mt-6"
onPress={handleSubmitWallet}
onPress={async () => {
if (privy.authenticated) {
await privy.logout();
}
privy.login();
}}
disabled={loginLoading}
>
<>
Expand Down
8 changes: 6 additions & 2 deletions packages/app/components/login/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export function Login() {
walletName,
showSignMessage,
verifySignature,
handleSubmitWallet,
loading,
} = useLogin();
const privy = usePrivy();
Expand Down Expand Up @@ -100,7 +99,12 @@ export function Login() {
variant="primary"
tw={`my-2 ${loading ? "opacity-[0.5]" : ""}`}
disabled={loading}
onPress={handleSubmitWallet}
onPress={async () => {
if (privy.authenticated) {
await privy.logout();
}
privy.login();
}}
>
<View tw="absolute left-4 top-3">
<Ethereum
Expand Down
2 changes: 1 addition & 1 deletion packages/app/lib/privy/privy-provider.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const PrivyProvider = ({ children }: any) => {
<PrivyProviderImpl
appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID}
config={{
loginMethods: ["sms", "google", "apple"],
loginMethods: ["wallet", "sms", "google", "apple"],
defaultChain: baseChain,
embeddedWallets: {
noPromptOnSignature: true,
Expand Down

0 comments on commit f1731b0

Please sign in to comment.