Skip to content

Commit

Permalink
feature(unlock-app): Upgrade @privy-io/react-auth to v2.2.1 (#15489)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency @privy-io/react-auth to v2

* update handleLoginComplete function signature

* update embedded wallet transaction types

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
0xTxbi and renovate[bot] authored Feb 4, 2025
1 parent d764d64 commit bc81e46
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 333 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@mdx-js/react": "3.1.0",
"@mui/material": "6.4.2",
"@mui/x-charts": "7.25.0",
"@privy-io/react-auth": "1.99.1",
"@privy-io/react-auth": "2.2.1",
"@tanstack/react-query": "5.66.0",
"@unlock-protocol/networks": "workspace:./packages/networks",
"@unlock-protocol/ui": "workspace:./packages/ui",
Expand Down
2 changes: 1 addition & 1 deletion unlock-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@guildxyz/sdk": "2.6.9",
"@headlessui/react": "2.1.9",
"@hookform/resolvers": "3.9.1",
"@privy-io/react-auth": "1.95.3",
"@privy-io/react-auth": "2.2.1",
"@radix-ui/react-avatar": "1.1.2",
"@sentry/nextjs": "7.119.2",
"@stripe/react-stripe-js": "3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function ConfirmCrossChainPurchaseWrapper({
}
}
const tx = await sendTransaction(txParams)
onConfirmed(lockAddress, route.network, tx.transactionHash)
onConfirmed(lockAddress, route.network, tx.hash)
} catch (error: any) {
onError(error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function ConfirmCryptoWrapper({
}

const tx = await sendTransaction(txParams)
onConfirmed(lockAddress, lockNetwork, tx.transactionHash)
onConfirmed(lockAddress, lockNetwork, tx.hash)
} catch (error: any) {
console.error('Transaction error details:', {
error,
Expand Down
8 changes: 7 additions & 1 deletion unlock-app/src/config/PrivyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
useCreateWallet,
User,
usePrivy,
LinkedAccountWithMetadata,
} from '@privy-io/react-auth'
import { ReactNode, useContext, useEffect, useState } from 'react'
import { config } from './app'
Expand Down Expand Up @@ -82,7 +83,12 @@ export const PrivyChild = ({ children }: { children: ReactNode }) => {
const { setAccount } = useContext(AuthenticationContext)

// handle onComplete logic
const handleLoginComplete = async (user: User) => {
const handleLoginComplete = async ({
user,
}: {
user: User
loginAccount: LinkedAccountWithMetadata | null
}) => {
// Proceed with normal login flow
await onSignedInWithPrivy(user)
}
Expand Down
Loading

0 comments on commit bc81e46

Please sign in to comment.