@b3dotfun/sdk 0.1.69-alpha.23 → 0.1.69-alpha.25
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/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -1
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +4 -2
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +37 -4
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +4 -1
- 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/BetterAuthSignIn.d.ts +6 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +2 -2
- 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/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +2 -2
- package/dist/cjs/global-account/react/components/index.d.ts +1 -0
- package/dist/cjs/global-account/react/components/index.js +5 -3
- package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +5 -4
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +2 -0
- package/dist/cjs/shared/constants/index.d.ts +1 -0
- package/dist/cjs/shared/constants/index.js +2 -1
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +3 -1
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +5 -3
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +38 -5
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +4 -1
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +6 -4
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +4 -2
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +25 -14
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +6 -1
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +2 -2
- 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 +16 -6
- 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/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +2 -2
- package/dist/esm/global-account/react/components/index.d.ts +1 -0
- package/dist/esm/global-account/react/components/index.js +1 -0
- package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +5 -4
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +2 -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/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/steps/LoginStepBetterAuth.d.ts +3 -1
- package/dist/types/global-account/react/components/index.d.ts +1 -0
- package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +2 -0
- package/dist/types/shared/constants/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +3 -1
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +18 -14
- package/src/global-account/react/components/ManageAccount/Header.tsx +74 -4
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +25 -19
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +14 -7
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +18 -14
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +29 -20
- package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +7 -1
- package/src/global-account/react/components/SignInWithB3/BetterAuthVerifyEmail.tsx +155 -0
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +43 -14
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +8 -1
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +4 -2
- package/src/global-account/react/components/index.ts +5 -0
- package/src/global-account/react/hooks/useBetterAuth.ts +5 -4
- package/src/global-account/react/stores/useModalStore.ts +2 -0
- package/src/shared/constants/index.ts +2 -0
|
@@ -14,7 +14,7 @@ const SOCIAL_PROVIDERS = [
|
|
|
14
14
|
{ id: "microsoft", label: "Microsoft" },
|
|
15
15
|
{ id: "slack", label: "Slack" },
|
|
16
16
|
];
|
|
17
|
-
export function LoginStepBetterAuth({ onSuccess, onError }) {
|
|
17
|
+
export function LoginStepBetterAuth({ onSuccess, onError, verifyEmailRedirectTo }) {
|
|
18
18
|
const { partnerId } = useB3Config();
|
|
19
19
|
const { signInWithEmail, signUpWithEmail, signInWithSocial, requestPasswordReset } = useBetterAuth();
|
|
20
20
|
const [mode, setMode] = useState("sign-in");
|
|
@@ -45,7 +45,7 @@ export function LoginStepBetterAuth({ onSuccess, onError }) {
|
|
|
45
45
|
setError(null);
|
|
46
46
|
if (mode === "sign-up") {
|
|
47
47
|
debug("Signing up", { email: normalizedEmail, name: name.trim() });
|
|
48
|
-
await signUpWithEmail(normalizedEmail, password, name.trim());
|
|
48
|
+
await signUpWithEmail(normalizedEmail, password, name.trim(), verifyEmailRedirectTo);
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
51
|
debug("Signing in", { email: normalizedEmail });
|
|
@@ -8,6 +8,7 @@ export { useB3Config } from "./B3Provider/useB3Config";
|
|
|
8
8
|
export { StyleRoot } from "./StyleRoot";
|
|
9
9
|
export { BetterAuthResetPassword, type BetterAuthResetPasswordProps } from "./SignInWithB3/BetterAuthResetPassword";
|
|
10
10
|
export { BetterAuthSignIn, type BetterAuthSignInProps } from "./SignInWithB3/BetterAuthSignIn";
|
|
11
|
+
export { BetterAuthVerifyEmail, type BetterAuthVerifyEmailProps, type BetterAuthVerifyEmailState, } from "./SignInWithB3/BetterAuthVerifyEmail";
|
|
11
12
|
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
12
13
|
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
13
14
|
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
@@ -10,6 +10,7 @@ export { StyleRoot } from "./StyleRoot.js";
|
|
|
10
10
|
// SignInWithB3 Components
|
|
11
11
|
export { BetterAuthResetPassword } from "./SignInWithB3/BetterAuthResetPassword.js";
|
|
12
12
|
export { BetterAuthSignIn } from "./SignInWithB3/BetterAuthSignIn.js";
|
|
13
|
+
export { BetterAuthVerifyEmail, } from "./SignInWithB3/BetterAuthVerifyEmail.js";
|
|
13
14
|
export { AuthButton } from "./SignInWithB3/components/AuthButton.js";
|
|
14
15
|
export { PermissionItem } from "./SignInWithB3/components/PermissionItem.js";
|
|
15
16
|
export { WalletRow } from "./SignInWithB3/components/WalletRow.js";
|
|
@@ -13,7 +13,7 @@ export declare class EmailVerificationRequiredError extends Error {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function useBetterAuth(): {
|
|
15
15
|
signInWithEmail: (email: string, password: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
16
|
-
signUpWithEmail: (email: string, password: string, name: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
16
|
+
signUpWithEmail: (email: string, password: string, name: string, verifyCallbackURL?: string) => Promise<import("@feathersjs/authentication").AuthenticationResult>;
|
|
17
17
|
signInWithSocial: (provider: BetterAuthSocialProvider) => Promise<void>;
|
|
18
18
|
requestPasswordReset: (email: string, redirectTo?: string) => Promise<{
|
|
19
19
|
data: {
|
|
@@ -65,7 +65,7 @@ export function useBetterAuth() {
|
|
|
65
65
|
throw error;
|
|
66
66
|
}
|
|
67
67
|
}, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting]);
|
|
68
|
-
const signUpWithEmail = useCallback(async (email, password, name) => {
|
|
68
|
+
const signUpWithEmail = useCallback(async (email, password, name, verifyCallbackURL) => {
|
|
69
69
|
debug("Signing up with email", { email, name });
|
|
70
70
|
setHasStartedConnecting(true);
|
|
71
71
|
setIsAuthenticating(true);
|
|
@@ -76,11 +76,12 @@ export function useBetterAuth() {
|
|
|
76
76
|
}
|
|
77
77
|
const token = result.data?.token;
|
|
78
78
|
if (!token) {
|
|
79
|
-
// requireEmailVerification is enabled — send verification email
|
|
80
|
-
//
|
|
79
|
+
// requireEmailVerification is enabled — send verification email with
|
|
80
|
+
// a callbackURL Better Auth redirects to after server-side verify.
|
|
81
|
+
// Pass verifyCallbackURL to land on a dedicated confirmation page.
|
|
81
82
|
await betterAuthClient.sendVerificationEmail({
|
|
82
83
|
email,
|
|
83
|
-
callbackURL: `${window.location.origin}?authStrategy=better-auth`,
|
|
84
|
+
callbackURL: verifyCallbackURL || `${window.location.origin}?authStrategy=better-auth`,
|
|
84
85
|
});
|
|
85
86
|
throw new EmailVerificationRequiredError();
|
|
86
87
|
}
|
|
@@ -41,6 +41,8 @@ export interface SignInWithB3ModalProps extends BaseModalProps {
|
|
|
41
41
|
source?: "signInWithB3Button" | "requestPermissions";
|
|
42
42
|
/** Whether to show the signers enabled modal */
|
|
43
43
|
signersEnabled?: boolean;
|
|
44
|
+
/** URL Better Auth redirects to after server-side email verification. */
|
|
45
|
+
verifyEmailRedirectTo?: string;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Props for the Request Permissions modal
|
|
@@ -16,3 +16,4 @@ export declare const CLIENT_APP_BUNDLE_ID: string;
|
|
|
16
16
|
export declare const B3_AUTH_COOKIE_NAME = "b3-auth";
|
|
17
17
|
export declare const ENS_GATEWAY_URL = "https://ens-gateway.b3.fun/";
|
|
18
18
|
export declare const PUBLIC_BASE_RPC_URL = "https://base-rpc.publicnode.com";
|
|
19
|
+
export declare const AVATAR_COLORS: string[];
|
|
@@ -21,3 +21,4 @@ export const CLIENT_APP_BUNDLE_ID = process.env.EXPO_PUBLIC_B3_BUNDLE_ID || "";
|
|
|
21
21
|
export const B3_AUTH_COOKIE_NAME = "b3-auth";
|
|
22
22
|
export const ENS_GATEWAY_URL = "https://ens-gateway.b3.fun/";
|
|
23
23
|
export const PUBLIC_BASE_RPC_URL = "https://base-rpc.publicnode.com";
|
|
24
|
+
export const AVATAR_COLORS = ["#3368ef", "#272727", "#6366f1", "#06b6d4", "#eeb0d9", "#ba3fbf", "#ff777b", "#dfbb53"];
|