try fix auth

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-17 13:13:52 +01:00
parent 743aa39036
commit e05d8bdca1
5 changed files with 30 additions and 17 deletions

View File

@@ -109,7 +109,6 @@ export default async function Page({
}),
getExists(organizationId, projectId),
]);
console.log(events[0]);
return (
<PageLayout title="Events" organizationSlug={organizationId}>

View File

@@ -1,5 +1,6 @@
import { appRouter } from '@/server/api/root';
import { auth } from '@clerk/nextjs';
import { getSession } from '@/server/auth';
import { getAuth } from '@clerk/nextjs/server';
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
const handler = (req: Request) =>
@@ -7,12 +8,10 @@ const handler = (req: Request) =>
endpoint: '/api/trpc',
req,
router: appRouter,
createContext: () => {
async createContext({ req }) {
console.log('------- createContext --------');
const session = auth();
console.log('session', session);
const session = getAuth(req as any);
console.log('session', JSON.stringify(session, null, 2));
return {
session,
};