mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-05-08 13:58:55 -04:00
migrate: replace NextAuth.js with Better Auth
- Install better-auth and @better-auth/drizzle-adapter - Create src/lib/auth.ts with Better Auth configuration using bcrypt - Update database schema: change auth table IDs from uuid to text - Update route handler from /api/auth/[...nextauth] to /api/auth/[...all] - Update tRPC context and middleware for Better Auth session handling - Update client components to use Better Auth APIs (signIn, signOut) - Update seed script with text-based IDs and correct account schema - Fix type errors in wizard components (robotId, optional chaining) - Fix API paths: api.robots.initialize -> api.robots.plugins.initialize - Update auth router to use text IDs for Better Auth compatibility Note: Auth tables were reset - users will need to re-register.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { signOut, useSession } from "next-auth/react";
|
||||
import { signOut, useSession } from "~/lib/auth-client";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
BarChart3,
|
||||
@@ -203,7 +203,8 @@ export function AppSidebar({
|
||||
: [];
|
||||
|
||||
const handleSignOut = async () => {
|
||||
await signOut({ callbackUrl: "/" });
|
||||
await signOut();
|
||||
window.location.href = "/";
|
||||
};
|
||||
|
||||
const handleStudySelect = async (studyId: string) => {
|
||||
|
||||
Reference in New Issue
Block a user