feat: migrated packages properly, using packages in web app
This commit is contained in:
@ -19,6 +19,8 @@
|
|||||||
"@ffmpeg/util": "^0.12.2",
|
"@ffmpeg/util": "^0.12.2",
|
||||||
"@hello-pangea/dnd": "^18.0.1",
|
"@hello-pangea/dnd": "^18.0.1",
|
||||||
"@hookform/resolvers": "^3.9.1",
|
"@hookform/resolvers": "^3.9.1",
|
||||||
|
"@opencut/auth": "workspace:*",
|
||||||
|
"@opencut/db": "workspace:*",
|
||||||
"@types/pg": "^8.15.4",
|
"@types/pg": "^8.15.4",
|
||||||
"@upstash/ratelimit": "^2.0.5",
|
"@upstash/ratelimit": "^2.0.5",
|
||||||
"@upstash/redis": "^1.35.0",
|
"@upstash/redis": "^1.35.0",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { auth } from "@/lib/auth";
|
import { auth } from "@opencut/auth/server";
|
||||||
import { toNextJsHandler } from "better-auth/next-js";
|
import { toNextJsHandler } from "better-auth/next-js";
|
||||||
|
|
||||||
export const { POST, GET } = toNextJsHandler(auth);
|
export const { POST, GET } = toNextJsHandler(auth);
|
@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { signUp, signIn } from "@/lib/auth-client";
|
import { signUp, signIn } from "@opencut/auth/client";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
|
@ -5,7 +5,7 @@ import Image from "next/image";
|
|||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import { ArrowRight } from "lucide-react";
|
import { ArrowRight } from "lucide-react";
|
||||||
import { HeaderBase } from "./header-base";
|
import { HeaderBase } from "./header-base";
|
||||||
import { useSession } from "@/lib/auth-client";
|
import { useSession } from "@opencut/auth/client";
|
||||||
import { getStars } from "@/lib/fetchGhStars";
|
import { getStars } from "@/lib/fetchGhStars";
|
||||||
import { Star } from "lucide-react";
|
import { Star } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
import { createAuthClient } from "better-auth/react";
|
|
||||||
export const { signIn, signUp, useSession } = createAuthClient({
|
|
||||||
baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL!,
|
|
||||||
});
|
|
@ -1,29 +0,0 @@
|
|||||||
import { betterAuth } from "better-auth";
|
|
||||||
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
||||||
import { db } from "./db";
|
|
||||||
|
|
||||||
export const auth = betterAuth({
|
|
||||||
database: drizzleAdapter(db, {
|
|
||||||
provider: "pg",
|
|
||||||
usePlural: true,
|
|
||||||
}),
|
|
||||||
secret: process.env.BETTER_AUTH_SECRET!,
|
|
||||||
user: {
|
|
||||||
deleteUser: {
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
emailAndPassword: {
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
socialProviders: {
|
|
||||||
google: {
|
|
||||||
clientId: process.env.GOOGLE_CLIENT_ID as string,
|
|
||||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
appName: "OpenCut",
|
|
||||||
trustedOrigins: ["http://localhost:3000"],
|
|
||||||
});
|
|
||||||
|
|
||||||
export type Auth = typeof auth;
|
|
Reference in New Issue
Block a user