mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-18 11:32:15 -05:00
docs: use APIRoute instead of Route for tanstack start api routes (#943)
* fix(docs): use `APIRoute` instead of `Route` for tanstack start api routes * fix(cli): remove unused import in drizzle schema
This commit is contained in:
@@ -401,7 +401,7 @@ The server provides a `session` object that you can use to access the session da
|
||||
import { auth } from "./auth";
|
||||
import { createAPIFileRoute } from "@tanstack/start/api";
|
||||
|
||||
export const Route = createAPIFileRoute("/api/$")({
|
||||
export const APIRoute = createAPIFileRoute("/api/$")({
|
||||
GET: async ({ request }) => {
|
||||
const session = await auth.api.getSession({
|
||||
headers: request.headers
|
||||
|
||||
@@ -363,7 +363,7 @@ Better Auth supports any backend framework with standard Request and Response ob
|
||||
import { auth } from '~/lib/server/auth'
|
||||
import { createAPIFileRoute } from '@tanstack/start/api'
|
||||
|
||||
export const Route = createAPIFileRoute('/api/auth/$')({
|
||||
export const APIRoute = createAPIFileRoute('/api/auth/$')({
|
||||
GET: ({ request }) => {
|
||||
return auth.handler(request)
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@ Create a new file: `/app/routes/api/auth/$.ts`
|
||||
import { auth } from '@/lib/auth'
|
||||
import { createAPIFileRoute } from '@tanstack/start/api'
|
||||
|
||||
export const Route = createAPIFileRoute('/api/auth/$')({
|
||||
export const APIRoute = createAPIFileRoute('/api/auth/$')({
|
||||
GET: ({ request }) => {
|
||||
return auth.handler(request)
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createAPIFileRoute } from "@tanstack/start/api";
|
||||
import { auth } from "~/lib/auth";
|
||||
|
||||
export const Route = createAPIFileRoute("/api/auth/$")({
|
||||
export const APIRoute = createAPIFileRoute("/api/auth/$")({
|
||||
GET: ({ request }) => {
|
||||
return auth.handler(request);
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { pgTable, text, integer, timestamp, boolean } from "drizzle-orm/pg-core";
|
||||
import { pgTable, text, timestamp, boolean } from "drizzle-orm/pg-core";
|
||||
|
||||
export const user = pgTable("user", {
|
||||
id: text("id").primaryKey(),
|
||||
|
||||
Reference in New Issue
Block a user