@b3dotfun/sdk 0.1.69-test.0 → 0.1.70-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +12 -4
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +7 -3
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +6 -5
- package/dist/cjs/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/cjs/anyspend/react/components/checkout/CartSummary.js +13 -11
- package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.js +5 -4
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.js +3 -6
- package/dist/cjs/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/cjs/anyspend/react/components/checkout/PriceSkeleton.js +9 -0
- package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.js +3 -2
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +5 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +17 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +3 -2
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.js +31 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +6 -5
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +4 -2
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +36 -4
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +4 -1
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +5 -3
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +3 -1
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +25 -14
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +3 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +6 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +15 -5
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.js +85 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +14 -4
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/components/PasswordInput.js +10 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +8 -5
- package/dist/cjs/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/cjs/global-account/react/components/UserAvatar/UserAvatar.js +27 -0
- package/dist/cjs/global-account/react/components/index.d.ts +3 -0
- package/dist/cjs/global-account/react/components/index.js +10 -3
- package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +19 -17
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/cjs/shared/constants/index.d.ts +1 -0
- package/dist/cjs/shared/constants/index.js +2 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +12 -4
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +7 -3
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +6 -5
- package/dist/esm/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/esm/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/esm/anyspend/react/components/checkout/CartSummary.js +13 -11
- package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.js +5 -4
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.js +3 -6
- package/dist/esm/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/esm/anyspend/react/components/checkout/PriceSkeleton.js +6 -0
- package/dist/esm/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/ShippingSelector.js +3 -2
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -1
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +5 -1
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +17 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +3 -2
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.js +27 -0
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +4 -3
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +5 -3
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +37 -5
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +4 -1
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +7 -1
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +6 -4
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +5 -3
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +25 -14
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +4 -3
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +6 -1
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +16 -6
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.js +82 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +15 -5
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/esm/global-account/react/components/SignInWithB3/components/PasswordInput.js +7 -0
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +8 -5
- package/dist/esm/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/esm/global-account/react/components/UserAvatar/UserAvatar.js +21 -0
- package/dist/esm/global-account/react/components/index.d.ts +3 -0
- package/dist/esm/global-account/react/components/index.js +4 -0
- package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +12 -10
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/esm/shared/constants/index.d.ts +1 -0
- package/dist/esm/shared/constants/index.js +1 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CartItemRow.d.ts +2 -1
- package/dist/types/anyspend/react/components/checkout/CartSummary.d.ts +6 -4
- package/dist/types/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/DiscountCodeInput.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/PriceSkeleton.d.ts +5 -0
- package/dist/types/anyspend/react/components/checkout/ShippingSelector.d.ts +3 -1
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +5 -1
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +17 -1
- package/dist/types/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +17 -0
- package/dist/types/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +6 -1
- package/dist/types/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.d.ts +37 -0
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Flow.d.ts +1 -1
- package/dist/types/global-account/react/components/SignInWithB3/components/PasswordInput.d.ts +10 -0
- package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/types/global-account/react/components/UserAvatar/UserAvatar.d.ts +18 -0
- package/dist/types/global-account/react/components/index.d.ts +3 -0
- package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
- package/dist/types/shared/constants/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +24 -12
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +6 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +12 -2
- package/src/anyspend/react/components/AnySpendDeposit.tsx +38 -31
- package/src/anyspend/react/components/AnySpendNFT.tsx +4 -0
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +4 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +10 -4
- package/src/anyspend/react/components/checkout/CartItemRow.tsx +2 -1
- package/src/anyspend/react/components/checkout/CartSummary.tsx +24 -20
- package/src/anyspend/react/components/checkout/CheckoutCartPanel.tsx +12 -3
- package/src/anyspend/react/components/checkout/CheckoutFormPanel.tsx +5 -0
- package/src/anyspend/react/components/checkout/DiscountCodeInput.tsx +15 -5
- package/src/anyspend/react/components/checkout/PriceSkeleton.tsx +19 -0
- package/src/anyspend/react/components/checkout/ShippingSelector.tsx +5 -1
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +3 -1
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +6 -0
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +36 -15
- package/src/global-account/react/components/B3Provider/BetterAuthClientProvider.tsx +40 -0
- package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +4 -3
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +18 -14
- package/src/global-account/react/components/ManageAccount/Header.tsx +71 -4
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +25 -19
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +13 -0
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +14 -7
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +15 -32
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +29 -20
- package/src/global-account/react/components/SignInWithB3/BetterAuthResetPassword.tsx +6 -7
- package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +27 -7
- package/src/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.tsx +155 -0
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +42 -13
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +8 -1
- package/src/global-account/react/components/SignInWithB3/components/PasswordInput.tsx +62 -0
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +13 -6
- package/src/global-account/react/components/UserAvatar/UserAvatar.tsx +45 -0
- package/src/global-account/react/components/index.ts +9 -0
- package/src/global-account/react/hooks/useBetterAuth.ts +12 -10
- package/src/global-account/react/stores/useModalStore.ts +4 -0
- package/src/shared/constants/index.ts +2 -0
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
CopyToClipboard,
|
|
3
3
|
ManageAccountModalProps,
|
|
4
4
|
useAuthentication,
|
|
5
|
+
useB3Config,
|
|
5
6
|
useModalStore,
|
|
6
7
|
} from "@b3dotfun/sdk/global-account/react";
|
|
7
8
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
@@ -10,6 +11,7 @@ import { Loader2 } from "lucide-react";
|
|
|
10
11
|
import { useState } from "react";
|
|
11
12
|
import { useActiveWallet, useConnectedWallets, useSetActiveWallet, useWalletImage } from "thirdweb/react";
|
|
12
13
|
import { Wallet } from "thirdweb/wallets";
|
|
14
|
+
import { UserAvatar } from "../UserAvatar/UserAvatar";
|
|
13
15
|
import { ChevronDownIcon } from "../icons/ChevronDownIcon";
|
|
14
16
|
import LinkIcon from "../icons/LinkIcon";
|
|
15
17
|
import SignOutIcon from "../icons/SignOutIcon";
|
|
@@ -89,7 +91,69 @@ function WalletItem({ wallet, isActive, onClick }: { wallet: Wallet; isActive: b
|
|
|
89
91
|
);
|
|
90
92
|
}
|
|
91
93
|
|
|
94
|
+
function BetterAuthHeader({ onLogout }: { onLogout?: () => void }) {
|
|
95
|
+
const contentType = useModalStore(state => state.contentType) as ManageAccountModalProps;
|
|
96
|
+
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
97
|
+
const partnerId = contentType?.partnerId;
|
|
98
|
+
const { logout, user } = useAuthentication(partnerId);
|
|
99
|
+
const [logoutLoading, setLogoutLoading] = useState(false);
|
|
100
|
+
|
|
101
|
+
const displayName = user?.username || user?.email || "Account";
|
|
102
|
+
|
|
103
|
+
const onLogoutEnhanced = async () => {
|
|
104
|
+
setLogoutLoading(true);
|
|
105
|
+
try {
|
|
106
|
+
await logout();
|
|
107
|
+
onLogout?.();
|
|
108
|
+
} finally {
|
|
109
|
+
setB3ModalOpen(false);
|
|
110
|
+
setLogoutLoading(false);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<div className="bg-b3-background border-b3-line flex items-center justify-between border-b px-5 py-3">
|
|
116
|
+
<div className="flex items-center gap-2">
|
|
117
|
+
<UserAvatar avatarUrl={user?.avatar} name={displayName} size={40} className="shrink-0" />
|
|
118
|
+
<div className="flex flex-col gap-0.5">
|
|
119
|
+
{user?.username && (
|
|
120
|
+
<p className="text-b3-grey font-neue-montreal-semibold text-left text-sm">{user.username}</p>
|
|
121
|
+
)}
|
|
122
|
+
{user?.email && (
|
|
123
|
+
<div className="flex items-center gap-1">
|
|
124
|
+
<p className="text-b3-foreground-muted font-neue-montreal-medium text-sm">{user.email}</p>
|
|
125
|
+
<CopyToClipboard text={user.email} />
|
|
126
|
+
</div>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
<button
|
|
131
|
+
className="border-b3-line hover:bg-b3-line flex items-center justify-center gap-1.5 rounded-xl border border-solid px-3 py-2 transition-colors"
|
|
132
|
+
onClick={onLogoutEnhanced}
|
|
133
|
+
disabled={logoutLoading}
|
|
134
|
+
>
|
|
135
|
+
{logoutLoading ? (
|
|
136
|
+
<Loader2 className="animate-spin" size={16} />
|
|
137
|
+
) : (
|
|
138
|
+
<SignOutIcon size={16} className="text-b3-grey" />
|
|
139
|
+
)}
|
|
140
|
+
<p className="text-b3-grey font-neue-montreal-semibold text-sm">Sign out</p>
|
|
141
|
+
</button>
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
92
146
|
export function Header({ onLogout }: { onLogout?: () => void }) {
|
|
147
|
+
const { authStrategy } = useB3Config();
|
|
148
|
+
|
|
149
|
+
if (authStrategy === "better-auth") {
|
|
150
|
+
return <BetterAuthHeader onLogout={onLogout} />;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return <WalletHeader onLogout={onLogout} />;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function WalletHeader({ onLogout }: { onLogout?: () => void }) {
|
|
93
157
|
const activeWallet = useActiveWallet();
|
|
94
158
|
|
|
95
159
|
const connectedWallets = useConnectedWallets();
|
|
@@ -110,10 +174,13 @@ export function Header({ onLogout }: { onLogout?: () => void }) {
|
|
|
110
174
|
|
|
111
175
|
const onLogoutEnhanced = async () => {
|
|
112
176
|
setLogoutLoading(true);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
177
|
+
try {
|
|
178
|
+
await logout();
|
|
179
|
+
onLogout?.();
|
|
180
|
+
} finally {
|
|
181
|
+
setB3ModalOpen(false);
|
|
182
|
+
setLogoutLoading(false);
|
|
183
|
+
}
|
|
117
184
|
};
|
|
118
185
|
|
|
119
186
|
const handleWalletSwitch = (wallet: Wallet) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
1
2
|
import { Tabs, TabsContent, TabsList, TabTrigger } from "../ui/Tabs";
|
|
2
3
|
import { Header } from "./Header";
|
|
3
4
|
import HomeActions from "./HomeActions";
|
|
@@ -11,31 +12,36 @@ interface HomeContentProps {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export function HomeContent({ showDeposit = false, showSwap = true }: HomeContentProps) {
|
|
15
|
+
const { authStrategy } = useB3Config();
|
|
16
|
+
const isBetterAuth = authStrategy === "better-auth";
|
|
17
|
+
|
|
14
18
|
return (
|
|
15
19
|
<div className="flex flex-col">
|
|
16
20
|
<Header />
|
|
17
21
|
<div className="flex flex-col">
|
|
18
22
|
<ProfileSection />
|
|
19
23
|
|
|
20
|
-
<HomeActions showDeposit={showDeposit} showSwap={showSwap} />
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
{!isBetterAuth && <HomeActions showDeposit={showDeposit} showSwap={showSwap} />}
|
|
25
|
+
{!isBetterAuth && (
|
|
26
|
+
<div className="b3-modal-balance-content space-y-2 p-5">
|
|
27
|
+
<Tabs defaultValue={"balance"}>
|
|
28
|
+
<TabsList className="b3-modal-balance-tabs-list">
|
|
29
|
+
<TabTrigger value="balance" className="font-neue-montreal-semibold p-0 pr-3">
|
|
30
|
+
Balance
|
|
31
|
+
</TabTrigger>
|
|
32
|
+
<TabTrigger value="nfts" className="font-neue-montreal-semibold p-0 pr-3">
|
|
33
|
+
NFTs
|
|
34
|
+
</TabTrigger>
|
|
35
|
+
</TabsList>
|
|
36
|
+
<TabsContent value="balance" className="px-0 pb-4 pt-2">
|
|
37
|
+
<TokenContent />
|
|
38
|
+
</TabsContent>
|
|
39
|
+
<TabsContent value="nfts" className="px-0 pb-4 pt-2">
|
|
40
|
+
<NFTContent />
|
|
41
|
+
</TabsContent>
|
|
42
|
+
</Tabs>
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
39
45
|
</div>
|
|
40
46
|
</div>
|
|
41
47
|
);
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
ManageAccountModalProps,
|
|
3
3
|
TabsContentPrimitive,
|
|
4
4
|
TabsPrimitive,
|
|
5
|
+
useB3Config,
|
|
5
6
|
useModalStore,
|
|
6
7
|
} from "@b3dotfun/sdk/global-account/react";
|
|
7
8
|
import { Chain } from "thirdweb";
|
|
@@ -74,9 +75,21 @@ export function ManageAccount({
|
|
|
74
75
|
showSwap,
|
|
75
76
|
showDeposit,
|
|
76
77
|
}: ManageAccountProps) {
|
|
78
|
+
const { authStrategy } = useB3Config();
|
|
79
|
+
const isBetterAuth = authStrategy === "better-auth";
|
|
77
80
|
const contentType = useModalStore(state => state.contentType);
|
|
78
81
|
const { activeTab = "home", setActiveTab } = contentType as ManageAccountModalProps;
|
|
79
82
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
83
|
+
|
|
84
|
+
// Better Auth: single-view layout — no Home/Swap tabs, just settings content
|
|
85
|
+
if (isBetterAuth) {
|
|
86
|
+
return (
|
|
87
|
+
<div className="b3-manage-account flex-1">
|
|
88
|
+
<SettingsContent partnerId={partnerId} onLogout={onLogout} chain={chain} />
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
80
93
|
return (
|
|
81
94
|
<div className="b3-manage-account flex-1">
|
|
82
95
|
<TabsPrimitive
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAccountWallet,
|
|
3
|
+
useB3Config,
|
|
3
4
|
useModalStore,
|
|
4
5
|
useProfile,
|
|
5
6
|
useSimBalance,
|
|
6
7
|
useUser,
|
|
7
8
|
} from "@b3dotfun/sdk/global-account/react";
|
|
8
9
|
import { validateImageUrl } from "@b3dotfun/sdk/global-account/react/utils/profileDisplay";
|
|
10
|
+
import { AVATAR_COLORS } from "@b3dotfun/sdk/shared/constants";
|
|
9
11
|
import { formatUsername } from "@b3dotfun/sdk/shared/utils";
|
|
10
12
|
import { formatDisplayNumber } from "@b3dotfun/sdk/shared/utils/number";
|
|
11
13
|
import Avatar from "boring-avatars";
|
|
@@ -15,9 +17,9 @@ import { useActiveAccount } from "thirdweb/react";
|
|
|
15
17
|
import { useFirstEOA } from "../../hooks/useFirstEOA";
|
|
16
18
|
import { IPFSMediaRenderer } from "../IPFSMediaRenderer/IPFSMediaRenderer";
|
|
17
19
|
|
|
18
|
-
const AVATAR_COLORS = ["#3368ef", "#272727", "#6366f1", "#06b6d4", "#eeb0d9", "#ba3fbf", "#ff777b", "#dfbb53"];
|
|
19
|
-
|
|
20
20
|
const ProfileSection = () => {
|
|
21
|
+
const { authStrategy } = useB3Config();
|
|
22
|
+
const isBetterAuth = authStrategy === "better-auth";
|
|
21
23
|
const account = useActiveAccount();
|
|
22
24
|
const { address: eoaAddress } = useFirstEOA();
|
|
23
25
|
const { address: smartWalletAddress } = useAccountWallet();
|
|
@@ -60,7 +62,7 @@ const ProfileSection = () => {
|
|
|
60
62
|
}, [avatarSrc]);
|
|
61
63
|
|
|
62
64
|
const currentUsername = user?.username || profile?.displayName || formatUsername(profile?.name || "");
|
|
63
|
-
const avatarSeed = eoaAddress || account?.address || smartWalletAddress || currentUsername || "user";
|
|
65
|
+
const avatarSeed = eoaAddress || account?.address || smartWalletAddress || currentUsername || user?.email || "user";
|
|
64
66
|
|
|
65
67
|
return (
|
|
66
68
|
<div className="flex items-center justify-between px-5 py-6">
|
|
@@ -87,13 +89,18 @@ const ProfileSection = () => {
|
|
|
87
89
|
</button>
|
|
88
90
|
</div>
|
|
89
91
|
<div className="global-account-profile-info flex flex-col gap-1">
|
|
90
|
-
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
{!isBetterAuth && (
|
|
93
|
+
<h2 className="text-b3-grey font-neue-montreal-semibold flex h-[38px] items-center gap-1 text-xl">
|
|
94
|
+
<div className="text-b3-foreground-muted"> $</div>
|
|
95
|
+
<div className="text-[30px]">{formatDisplayNumber(totalBalanceUsd, { fractionDigits: 2 })}</div>
|
|
96
|
+
</h2>
|
|
97
|
+
)}
|
|
94
98
|
<div className="b3-modal-username font-neue-montreal-semibold text-base leading-none text-[#0B57C2]">
|
|
95
99
|
{currentUsername}
|
|
96
100
|
</div>
|
|
101
|
+
{isBetterAuth && user?.email && (
|
|
102
|
+
<div className="text-b3-foreground-muted font-neue-montreal-medium text-sm">{user.email}</div>
|
|
103
|
+
)}
|
|
97
104
|
</div>
|
|
98
105
|
</div>
|
|
99
106
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useAuthentication, useModalStore } from "@b3dotfun/sdk/global-account/react";
|
|
1
|
+
import { useAuthentication, useB3Config, useModalStore } from "@b3dotfun/sdk/global-account/react";
|
|
2
2
|
import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
|
|
3
3
|
import { getSessionDurationDays, SESSION_DURATION_LABELS } from "@b3dotfun/sdk/shared/utils/session-duration";
|
|
4
|
-
import { Loader2 } from "lucide-react";
|
|
4
|
+
import { Bell, Clock, Link, Loader2 } from "lucide-react";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { Chain } from "thirdweb";
|
|
7
7
|
import { useProfiles } from "thirdweb/react";
|
|
@@ -19,6 +19,8 @@ const SettingsContent = ({
|
|
|
19
19
|
onLogout?: () => void;
|
|
20
20
|
chain: Chain;
|
|
21
21
|
}) => {
|
|
22
|
+
const { authStrategy } = useB3Config();
|
|
23
|
+
const isBetterAuth = authStrategy === "better-auth";
|
|
22
24
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
23
25
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
24
26
|
const { logout, user } = useAuthentication(partnerId);
|
|
@@ -58,7 +60,7 @@ const SettingsContent = ({
|
|
|
58
60
|
|
|
59
61
|
return (
|
|
60
62
|
<div className="flex h-[470px] flex-col">
|
|
61
|
-
<ModalHeader showBackButton={false} showCloseButton={false} title="Settings" />
|
|
63
|
+
{!isBetterAuth && <ModalHeader showBackButton={false} showCloseButton={false} title="Settings" />}
|
|
62
64
|
|
|
63
65
|
{/* Profile Section */}
|
|
64
66
|
<div className="p-5">
|
|
@@ -69,41 +71,22 @@ const SettingsContent = ({
|
|
|
69
71
|
|
|
70
72
|
{/* Menu Items */}
|
|
71
73
|
<div className="space-y-3 px-5">
|
|
74
|
+
{!isBetterAuth && (
|
|
75
|
+
<SettingsMenuItem
|
|
76
|
+
icon={<Link size={18} className="text-[#51525c]" />}
|
|
77
|
+
title="Linked Accounts"
|
|
78
|
+
subtitle={`${profiles.length} connected account${profiles.length > 1 ? "s" : ""}`}
|
|
79
|
+
onClick={() => handleNavigate("linkAccount")}
|
|
80
|
+
/>
|
|
81
|
+
)}
|
|
72
82
|
<SettingsMenuItem
|
|
73
|
-
icon={
|
|
74
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
75
|
-
<path
|
|
76
|
-
d="M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z"
|
|
77
|
-
fill="#F4F4F5"
|
|
78
|
-
/>
|
|
79
|
-
</svg>
|
|
80
|
-
}
|
|
81
|
-
title="Linked Accounts"
|
|
82
|
-
subtitle={`${profiles.length} connected account${profiles.length > 1 ? "s" : ""}`}
|
|
83
|
-
onClick={() => handleNavigate("linkAccount")}
|
|
84
|
-
/>
|
|
85
|
-
<SettingsMenuItem
|
|
86
|
-
icon={
|
|
87
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
88
|
-
<path
|
|
89
|
-
d="M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z"
|
|
90
|
-
fill="#F4F4F5"
|
|
91
|
-
/>
|
|
92
|
-
</svg>
|
|
93
|
-
}
|
|
83
|
+
icon={<Bell size={18} className="text-[#51525c]" />}
|
|
94
84
|
title="Notifications"
|
|
95
85
|
subtitle="Manage your notifications"
|
|
96
86
|
onClick={() => handleNavigate("notifications")}
|
|
97
87
|
/>
|
|
98
88
|
<SettingsMenuItem
|
|
99
|
-
icon={
|
|
100
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
101
|
-
<path
|
|
102
|
-
d="M0 12C0 5.37258 5.37258 0 12 0H28C34.6274 0 40 5.37258 40 12V28C40 34.6274 34.6274 40 28 40H12C5.37258 40 0 34.6274 0 28V12Z"
|
|
103
|
-
fill="#F4F4F5"
|
|
104
|
-
/>
|
|
105
|
-
</svg>
|
|
106
|
-
}
|
|
89
|
+
icon={<Clock size={18} className="text-[#51525c]" />}
|
|
107
90
|
title="Stay signed in"
|
|
108
91
|
subtitle={SESSION_DURATION_LABELS[sessionDays] ?? `${sessionDays} days`}
|
|
109
92
|
onClick={() => handleNavigate("sessionDuration")}
|
|
@@ -18,7 +18,8 @@ const SettingsProfileCard = () => {
|
|
|
18
18
|
address: eoaAddress || account?.address,
|
|
19
19
|
fresh: true,
|
|
20
20
|
});
|
|
21
|
-
const { partnerId } = useB3Config();
|
|
21
|
+
const { partnerId, authStrategy } = useB3Config();
|
|
22
|
+
const isBetterAuth = authStrategy === "better-auth";
|
|
22
23
|
const { user, setUser } = useAuthentication(partnerId);
|
|
23
24
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
24
25
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
@@ -78,25 +79,33 @@ const SettingsProfileCard = () => {
|
|
|
78
79
|
|
|
79
80
|
setIsSaving(true);
|
|
80
81
|
try {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
let updatedUser: Users;
|
|
83
|
+
if (isBetterAuth) {
|
|
84
|
+
// Better Auth: register username without wallet signing (DB-only, no ENS)
|
|
85
|
+
// Skip ens_normalize — it rejects underscores/mixed-case that are valid non-ENS usernames
|
|
86
|
+
const sanitizedUsername = editedUsername.trim().toLowerCase();
|
|
87
|
+
// Type assertion needed: b3-mono now accepts message/hash as optional for Better Auth users
|
|
88
|
+
updatedUser = (await app
|
|
89
|
+
.service("users")
|
|
90
|
+
.registerUsername({ username: sanitizedUsername } as any, {} as any)) as unknown as Users;
|
|
91
|
+
} else {
|
|
92
|
+
// Thirdweb: register username with wallet signature + on-chain ENS
|
|
93
|
+
const sanitizedUsername = ens_normalize(editedUsername.trim());
|
|
94
|
+
const b3Username = `${sanitizedUsername}.b3.fun`;
|
|
95
|
+
const usernameSignMessage = `Register "${b3Username}"`;
|
|
96
|
+
const usernameSignature = await account?.signMessage({ message: usernameSignMessage });
|
|
97
|
+
|
|
98
|
+
if (!usernameSignature) {
|
|
99
|
+
throw new Error("Failed to sign username registration message");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
updatedUser = (await app
|
|
103
|
+
.service("users")
|
|
104
|
+
.registerUsername(
|
|
105
|
+
{ username: sanitizedUsername, message: usernameSignMessage, hash: usernameSignature },
|
|
106
|
+
{} as any,
|
|
107
|
+
)) as unknown as Users;
|
|
88
108
|
}
|
|
89
|
-
|
|
90
|
-
console.log("@@usernameSignature", usernameSignature);
|
|
91
|
-
|
|
92
|
-
// Register username with ENS
|
|
93
|
-
// Note: Type assertion needed until @b3dotfun/b3-api package is updated with RegisterUsername type
|
|
94
|
-
const updatedUser = (await app
|
|
95
|
-
.service("users")
|
|
96
|
-
.registerUsername(
|
|
97
|
-
{ username: sanitizedUsername, message: usernameSignMessage, hash: usernameSignature },
|
|
98
|
-
{} as any,
|
|
99
|
-
)) as unknown as Users;
|
|
100
109
|
// Update user state - registerUsername returns an array with single user
|
|
101
110
|
setUser(Array.isArray(updatedUser) ? updatedUser[0] : updatedUser);
|
|
102
111
|
|
|
@@ -179,7 +188,7 @@ const SettingsProfileCard = () => {
|
|
|
179
188
|
<>
|
|
180
189
|
<div className="flex items-center gap-1">
|
|
181
190
|
<p className="b3-modal-username font-neue-montreal-semibold text-lg leading-none text-[#0B57C2]">
|
|
182
|
-
{currentUsername}
|
|
191
|
+
{currentUsername || user?.email}
|
|
183
192
|
</p>
|
|
184
193
|
</div>
|
|
185
194
|
<button
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Button
|
|
1
|
+
import { Button } from "@b3dotfun/sdk/global-account/react";
|
|
2
2
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { useBetterAuth } from "../../hooks/useBetterAuth";
|
|
5
|
+
import { PasswordInput } from "./components/PasswordInput";
|
|
5
6
|
|
|
6
7
|
const debug = debugB3React("BetterAuthResetPassword");
|
|
7
8
|
|
|
@@ -103,13 +104,12 @@ export function BetterAuthResetPassword({ token, onSuccess, onError, className }
|
|
|
103
104
|
<label className="mb-2 block text-xs font-medium uppercase tracking-wide text-gray-700 dark:text-gray-300">
|
|
104
105
|
New password
|
|
105
106
|
</label>
|
|
106
|
-
<
|
|
107
|
-
type="password"
|
|
107
|
+
<PasswordInput
|
|
108
108
|
placeholder="At least 8 characters"
|
|
109
109
|
value={password}
|
|
110
110
|
onChange={e => setPassword(e.target.value)}
|
|
111
111
|
disabled={isLoading}
|
|
112
|
-
className="h-11 px-4 text-[15px]"
|
|
112
|
+
className="h-11 px-4 pr-11 text-[15px]"
|
|
113
113
|
/>
|
|
114
114
|
</div>
|
|
115
115
|
|
|
@@ -117,8 +117,7 @@ export function BetterAuthResetPassword({ token, onSuccess, onError, className }
|
|
|
117
117
|
<label className="mb-2 block text-xs font-medium uppercase tracking-wide text-gray-700 dark:text-gray-300">
|
|
118
118
|
Confirm password
|
|
119
119
|
</label>
|
|
120
|
-
<
|
|
121
|
-
type="password"
|
|
120
|
+
<PasswordInput
|
|
122
121
|
placeholder="Repeat your password"
|
|
123
122
|
value={confirmPassword}
|
|
124
123
|
onChange={e => setConfirmPassword(e.target.value)}
|
|
@@ -126,7 +125,7 @@ export function BetterAuthResetPassword({ token, onSuccess, onError, className }
|
|
|
126
125
|
onKeyDown={e => {
|
|
127
126
|
if (e.key === "Enter") handleSubmit();
|
|
128
127
|
}}
|
|
129
|
-
className="h-11 px-4 text-[15px]"
|
|
128
|
+
className="h-11 px-4 pr-11 text-[15px]"
|
|
130
129
|
/>
|
|
131
130
|
</div>
|
|
132
131
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, Input, useAuthStore } from "@b3dotfun/sdk/global-account/react";
|
|
1
|
+
import { Button, Input, Loading, useAuthStore } from "@b3dotfun/sdk/global-account/react";
|
|
2
2
|
import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import {
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
type BetterAuthSocialProvider,
|
|
7
7
|
useBetterAuth,
|
|
8
8
|
} from "../../hooks/useBetterAuth";
|
|
9
|
+
import { PasswordInput } from "./components/PasswordInput";
|
|
9
10
|
import { strategyIcons, strategyLabels } from "./utils/signInUtils";
|
|
10
11
|
|
|
11
12
|
const debug = debugB3React("BetterAuthSignIn");
|
|
@@ -32,6 +33,11 @@ export interface BetterAuthSignInProps {
|
|
|
32
33
|
showEmail?: boolean;
|
|
33
34
|
/** URL to redirect to after password reset link is clicked. Token is appended as ?token=... */
|
|
34
35
|
passwordResetRedirectTo?: string;
|
|
36
|
+
/**
|
|
37
|
+
* URL Better Auth redirects to after server-side email verification. Render
|
|
38
|
+
* `BetterAuthVerifyEmail` at this route so the user gets a confirmation page.
|
|
39
|
+
*/
|
|
40
|
+
verifyEmailRedirectTo?: string;
|
|
35
41
|
/** Called after successful authentication */
|
|
36
42
|
onSuccess?: () => void;
|
|
37
43
|
/** Called on authentication error */
|
|
@@ -60,12 +66,15 @@ export function BetterAuthSignIn({
|
|
|
60
66
|
socialProviders = DEFAULT_SOCIAL_PROVIDERS.map(p => p.id),
|
|
61
67
|
showEmail = true,
|
|
62
68
|
passwordResetRedirectTo,
|
|
69
|
+
verifyEmailRedirectTo,
|
|
63
70
|
onSuccess,
|
|
64
71
|
onError,
|
|
65
72
|
className,
|
|
66
73
|
}: BetterAuthSignInProps) {
|
|
67
74
|
const { signInWithEmail, signUpWithEmail, signInWithSocial, requestPasswordReset } = useBetterAuth();
|
|
68
75
|
const isAuthenticated = useAuthStore(state => state.isAuthenticated);
|
|
76
|
+
const isAuthenticating = useAuthStore(state => state.isAuthenticating);
|
|
77
|
+
const hasStartedConnecting = useAuthStore(state => state.hasStartedConnecting);
|
|
69
78
|
|
|
70
79
|
const [mode, setMode] = useState<"sign-in" | "sign-up" | "forgot-password">("sign-in");
|
|
71
80
|
const [email, setEmail] = useState("");
|
|
@@ -83,7 +92,9 @@ export function BetterAuthSignIn({
|
|
|
83
92
|
|
|
84
93
|
const resolvedSubtitle =
|
|
85
94
|
mode === "forgot-password"
|
|
86
|
-
?
|
|
95
|
+
? resetEmailSent
|
|
96
|
+
? "We've sent a password reset link to your email"
|
|
97
|
+
: "Enter your email and we'll send you a reset link"
|
|
87
98
|
: subtitle || "Enter your credentials to access your account";
|
|
88
99
|
|
|
89
100
|
const handleForgotPassword = async () => {
|
|
@@ -111,6 +122,16 @@ export function BetterAuthSignIn({
|
|
|
111
122
|
.map(id => DEFAULT_SOCIAL_PROVIDERS.find(p => p.id === id))
|
|
112
123
|
.filter((p): p is SocialProviderConfig => !!p);
|
|
113
124
|
|
|
125
|
+
// Show loading during session restore (before any user interaction) to prevent
|
|
126
|
+
// the login form from flashing briefly after OAuth redirect.
|
|
127
|
+
if (isAuthenticating && !hasStartedConnecting) {
|
|
128
|
+
return (
|
|
129
|
+
<div className={`flex w-full max-w-[400px] items-center justify-center px-6 py-20 ${className || ""}`}>
|
|
130
|
+
<Loading variant="primary" size="lg" />
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
114
135
|
if (isAuthenticated) {
|
|
115
136
|
return null;
|
|
116
137
|
}
|
|
@@ -138,7 +159,7 @@ export function BetterAuthSignIn({
|
|
|
138
159
|
setError(null);
|
|
139
160
|
|
|
140
161
|
if (mode === "sign-up") {
|
|
141
|
-
await signUpWithEmail(normalizedEmail, password, name.trim());
|
|
162
|
+
await signUpWithEmail(normalizedEmail, password, name.trim(), verifyEmailRedirectTo);
|
|
142
163
|
} else {
|
|
143
164
|
await signInWithEmail(normalizedEmail, password);
|
|
144
165
|
}
|
|
@@ -334,16 +355,15 @@ export function BetterAuthSignIn({
|
|
|
334
355
|
</button>
|
|
335
356
|
)}
|
|
336
357
|
</div>
|
|
337
|
-
<
|
|
338
|
-
|
|
339
|
-
placeholder="Password"
|
|
358
|
+
<PasswordInput
|
|
359
|
+
key={mode}
|
|
340
360
|
value={password}
|
|
341
361
|
onChange={e => setPassword(e.target.value)}
|
|
342
362
|
disabled={isLoading}
|
|
343
363
|
onKeyDown={e => {
|
|
344
364
|
if (e.key === "Enter") handleEmailSubmit();
|
|
345
365
|
}}
|
|
346
|
-
className="h-11 px-4 text-[15px]"
|
|
366
|
+
className="h-11 px-4 pr-11 text-[15px]"
|
|
347
367
|
/>
|
|
348
368
|
</div>
|
|
349
369
|
|