Skip to content

Commit 4e64bf3

Browse files
authored
Merge pull request #113 from atomly/docs/better-auth-ui-upgrade
docs: Better Auth UI Upgrade Documentation
2 parents c3b2cda + 1bac8df commit 4e64bf3

File tree

27 files changed

+162
-225
lines changed

27 files changed

+162
-225
lines changed

.env.example

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ AUTH_SECRET='<YOUR_AUTH_SECRET>'
1616
AUTH_GOOGLE_ID='<AUTH_GOOGLE_ID>'
1717
AUTH_GOOGLE_SECRET='<AUTH_GOOGLE_SECRET>'
1818

19-
# Pre-configured Discord OAuth provider, works out-of-the-box.
20-
# @see https://www.better-auth.com/docs/authentication/discord
21-
AUTH_DISCORD_ID='<AUTH_DISCORD_ID>'
22-
AUTH_DISCORD_SECRET='<AUTH_DISCORD_SECRET>'
23-
2419
# Pre-configured GitHub OAuth provider, works out-of-the-box.
2520
# @see https://www.better-auth.com/docs/authentication/github
2621
AUTH_GITHUB_ID='<AUTH_GITHUB_ID>'

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@blocknote/react": "~0.39.1",
3131
"@blocknote/server-util": "~0.39.1",
3232
"@blocknote/xl-ai": "~0.39.1",
33-
"@daveyplate/better-auth-ui": "~2.1.11",
33+
"@daveyplate/better-auth-ui": "~3.2.5",
3434
"@hookform/resolvers": "~5.0.1",
3535
"@mantine/core": "~8.1.3",
3636
"@mastra/core": "~0.15.2",

apps/web/src/app/(app)/@appSidebar/_components/app-sidebar-pages.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import type { Page } from "@acme/db/schema";
44
import { useQuery } from "@tanstack/react-query";
55
import { BookOpen, ChevronRight } from "lucide-react";
6-
import { usePathname } from "next/navigation";
76
import { useState } from "react";
87
import {
98
Collapsible,
@@ -20,20 +19,22 @@ import { AppSidebarPageItem } from "./app-sidebar-page-item";
2019
import { CreatePageButton } from "./create-page-button";
2120

2221
type AppSidebarPagesProps = {
23-
pages: Page[];
22+
initialPages: Page[];
23+
defaultOpen?: boolean;
2424
};
2525

26-
export const AppSidebarPages = (props: AppSidebarPagesProps) => {
26+
export const AppSidebarPages = ({
27+
initialPages,
28+
defaultOpen = true,
29+
}: AppSidebarPagesProps) => {
2730
const trpc = useTRPC();
28-
const pathname = usePathname();
2931
const { state, setOpen } = useSidebar();
3032

3133
const { data: pages } = useQuery({
3234
...trpc.pages.getByUser.queryOptions(),
33-
initialData: props.pages,
35+
initialData: initialPages,
3436
});
3537

36-
const defaultOpen = pathname.includes("/pages/");
3738
const [isOpen, setIsOpen] = useState(defaultOpen);
3839

3940
const handlePagesClick = (e: React.MouseEvent) => {

apps/web/src/app/(app)/@appSidebar/_components/app-sidebar-user-settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function AppSidebarUserSettings() {
1515

1616
// Add a small delay to allow the dropdown to close before navigation
1717
requestAnimationFrame(() => {
18-
router.push("/auth/settings");
18+
router.push("/account/settings");
1919
});
2020
};
2121

apps/web/src/app/(app)/@appSidebar/default.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { AppSidebarUserSkeleton } from "./_components/app-sidebar-user-skeleton"
2121

2222
async function SuspendedAppSidebarPages() {
2323
const pages = await api.pages.getByUser();
24-
return <AppSidebarPages pages={pages} />;
24+
return <AppSidebarPages initialPages={pages} />;
2525
}
2626

2727
export default function AppSidebar() {

apps/web/src/app/(app)/@billingModal/_components/billing-error-boundary.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

apps/web/src/app/(app)/@billingModal/default.tsx

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/web/src/app/(app)/@billingModal/(.)subscription/page.tsx renamed to apps/web/src/app/(app)/@subscriptionModal/(.)subscription/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
} from "~/components/ui/dialog";
77
import { api } from "~/trpc/server";
88
import { SubscriptionView } from "../../../(dashboard)/subscription/_components/subscription-view";
9-
import { SubscriptionModal } from "./_components/subscription-modal";
9+
import { SubscriptionModal } from "../_components/subscription-modal";
1010

11-
export default async function SubscriptionBillingModalPage() {
11+
export default async function SubscriptionModalPage() {
1212
const subscription = await api.subscription.getSubscription();
1313
if (!subscription) {
1414
return redirect("/journal");
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,20 @@ import { useRouter } from "next/navigation";
44
import { useState } from "react";
55
import { Dialog } from "~/components/ui/dialog";
66

7-
export const SubscriptionModal = ({
8-
children,
9-
}: {
10-
children: React.ReactNode;
11-
}) => {
7+
export function SubscriptionModal({ children }: { children: React.ReactNode }) {
128
const router = useRouter();
139
const [isOpen, setIsOpen] = useState(true);
1410

15-
const handleOpenChange = (open: boolean) => {
11+
function handleOpenChange(open: boolean) {
1612
if (!open) {
1713
setIsOpen(false);
1814
router.back();
1915
}
20-
};
16+
}
2117

2218
return (
2319
<Dialog open={isOpen} onOpenChange={handleOpenChange}>
2420
{children}
2521
</Dialog>
2622
);
27-
};
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function DefaultSubscriptionModalPage() {
2+
return null;
3+
}

0 commit comments

Comments
 (0)