nicoalbanese / kirimase

Build full-stack Next.js apps, incredibly fast
https://kirimase.dev
MIT License
2.58k stars 118 forks source link

Auth scheme not generated #62

Closed tanjunior closed 11 months ago

tanjunior commented 11 months ago

kirimase -V 0.0.19

kirimase init ✔ Would you like to use TypeScript? … Yes ✔ Would you like to use ESLint? … Yes ✔ Would you like to use Tailwind CSS? … Yes ✔ Would you like to use src/ directory? … Yes ✔ Would you like to use App Router? (recommended) … Yes ✔ Would you like to customize the default import alias (@/*)? … No ? Are you using a 'src' folder? Yes ? Please pick your preferred package manager Bun ? Select a component library to use: Shadcn UI ? Select an ORM to use: Drizzle ? Please choose your DB type MySQL ? Please choose your DB Provider PlanetScale ? Would you like to include an example model? (suggested for new users) yes ? Select an authentication package to use: Clerk ? Select any miscellaneous packages to add: TRPC, Resend

src/app/api/account.route.ts

import { getUserAuth } from "@/lib/auth/utils";
import { db } from "@/lib/db";
import { users } from "@/lib/db/schema/auth"; //Cannot find module '@/lib/db/schema/auth' or its corresponding type declarations.
import { revalidatePath } from "next/cache";

export async function PUT(request: Request) {
  const { session } = await getUserAuth();
  if (!session) return new Response("Error", { status: 400 });
  const body = (await request.json()) as { name?: string; email?: string };

  await db.update(users).set({ ...body });
  revalidatePath("/account");
  return new Response(JSON.stringify({ message: "ok" }), { status: 200 });
}

src/lib/db/schema only contains computer.ts

nicoalbanese commented 11 months ago

Hey @tanjunior - thanks for flagging, this file is only necessary when using auth providers other than clerk. I will make sure it doesn't get generated in the next version!

nicoalbanese commented 11 months ago

This has been fixed with v0.0.20

tanjunior commented 11 months ago

This has been fixed with v0.0.20

That was fast! I will try to find time to contribute as well. I noticed that when choosing bun as package manager, sqlite cannot be choosen for db. But turso uses sqlite. Will make a PR when I get it down.