Next Auth + Create T3 App ( appDir )

did anybody manage to connect the appDir version of the CT3A with next-auth using a credentials provider? I can't seem to find a way to read a session after the login... Session is null after calling the getServerAuthSession() ...
5 Replies
West side ⁉
West side ⁉14mo ago
Have you found a way?
Nate Vukovich
Nate VukovichOP14mo ago
Well honestly not yet - I've continued with other page/component implementations. When I get back to it I'll let you know 😄
thomasdvd
thomasdvd13mo ago
this is my auth.ts file works for me
thomasdvd
thomasdvd13mo ago
NextAuthProvider.tsx to mount in root layout.tsx aroung {children}
"use client";

import { SessionProvider } from "next-auth/react";
import { type ReactNode } from "react";

export default function NextAuthProvider({
children,
}: {
children: ReactNode;
}) {
return <SessionProvider>{children}</SessionProvider>;
}
"use client";

import { SessionProvider } from "next-auth/react";
import { type ReactNode } from "react";

export default function NextAuthProvider({
children,
}: {
children: ReactNode;
}) {
return <SessionProvider>{children}</SessionProvider>;
}
AlexAnarcho
AlexAnarcho13mo ago
Heyo, I ahve not gotten this to work unfortunately. I am trying to do a very basic setup of NextAuth with the new appDir and trpc, but it does not work and i dont get how it should ideally work: https://create.t3.gg/en/usage/next-auth is still referring to the pages directory, so no real help either...
Create T3 App
NextAuth.js 🚀 Create T3 App
The best way to start a full-stack, typesafe Next.js app.
Want results from more Discord servers?
Add your server