vz
vz
BABetter Auth
Created by vz on 4/5/2025 in #help
subscription table is not generated
4 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
it's all working now. thank you @Ping
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
thanks! i realize that when you render something depdening on the session data and it's null at the begining, it just stops there and wont continue
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
no
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
const data = authClient.useSession(); console.log( "data from auth client in NavUser", JSON.stringify(data, null, 2), );
data from auth client in NavUser {
"data": null,
"error": null,
"isPending": true,
"isRefetching": false
}
data from auth client in NavUser {
"data": null,
"error": null,
"isPending": true,
"isRefetching": false
}
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
ah
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
and it's null
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
it's already one variable. const { data: authClientSession } = authClient.useSession(); console.log( "session from auth client in NavUser", JSON.stringify(authClientSession, null, 2),
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
i dont see any error tho
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
unfortunately no. i can see cookie is there from middleware loggings after signing in. GET /auth/login 200 in 971ms GET /api/auth/get-session 200 in 13ms 🍪 Session cookie: null 🍪 Session cookie: null session from auth server in LoginPage null GET /auth/login 200 in 75ms {"level":30,"time":1743794920050,"pid":64910,"hostname":"Weizhis-Mac-mini.local","msg":"Sending verification OTP to:"} POST /api/auth/email-otp/send-verification-otp 200 in 34ms {"level":30,"time":1743794920050,"pid":64910,"hostname":"Weizhis-Mac-mini.local","msg":"139991"} {"level":30,"time":1743794920050,"pid":64910,"hostname":"Weizhis-Mac-mini.local","msg":"sign-in"} POST /api/auth/sign-in/email-otp 200 in 39ms 🍪 Session cookie: Qu5xzZad3h3dVScTSuGRjvwxM8rlXH68.6ngMzfl7O9MP6zUNTlGGiYsUa8v8U%2FAn%2BOKibCqJYPI%3D GET /dashboard 200 in 31ms GET /api/auth/get-session 200 in 14ms GET /api/auth/get-session 200 in 17ms but not from useSession
session from auth client in NavUser null
session from auth client in NavUser null
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
wait. i thought you are saying "remove". let me try one more time
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
still not working. the component looks like
"use client";

import....

export function NavUser() {
const router = useRouter();
const { isMobile } = useSidebar();
const { data: authClientSession } = authClient.useSession();
console.log(
"session from auth client in NavUser",
JSON.stringify(authClientSession, null, 2),
);


return (
....
);
}
"use client";

import....

export function NavUser() {
const router = useRouter();
const { isMobile } = useSidebar();
const { data: authClientSession } = authClient.useSession();
console.log(
"session from auth client in NavUser",
JSON.stringify(authClientSession, null, 2),
);


return (
....
);
}
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
some tsx component with "use client";
30 replies
BABetter Auth
Created by vz on 4/4/2025 in #help
useSession returns null
auth looks like this:
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
}),
plugins: [
admin(),
organization(),
nextCookies(),
emailOTP({
async sendVerificationOTP({ email, otp, type }) {
logger.info("Sending verification OTP to:", email);
logger.info(otp, "OTP:");
logger.info(type, "Type:");
},
}),
],
});
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
}),
plugins: [
admin(),
organization(),
nextCookies(),
emailOTP({
async sendVerificationOTP({ email, otp, type }) {
logger.info("Sending verification OTP to:", email);
logger.info(otp, "OTP:");
logger.info(type, "Type:");
},
}),
],
});
and it's latest version 1.2.5
30 replies
BABetter Auth
Created by Ravi on 2/21/2025 in #help
signInEmail isn't properly setting cookies in production? (NextJS 15/Vercel)
Running into the same issue.
7 replies
BABetter Auth
Created by manu² on 2/22/2025 in #help
Neon Authorize + Better Auth JWT + Drizzle + Row Level Security
Thank you!!
34 replies
BABetter Auth
Created by manu² on 2/22/2025 in #help
Neon Authorize + Better Auth JWT + Drizzle + Row Level Security
do you have link to the github repo?
34 replies