Vinz
Vinz
BABetter Auth
Created by Ahmed on 3/6/2025 in #bug-reports
getSessionCookie() return null is some cases
sorry I wrote it wrong, because I just copy pasted it from the next docs. I had it correct with the default name in my code
const betterAuthSessionToken = (await cookies()).get("better-auth.session_token");
console.log(betterAuthSessionToken)
const betterAuthSessionToken = (await cookies()).get("better-auth.session_token");
console.log(betterAuthSessionToken)
22 replies
BABetter Auth
Created by Ahmed on 3/6/2025 in #bug-reports
getSessionCookie() return null is some cases
I have the same problem with getSessionCookie is null. Also when I check for cookies getAll() in the requests. But when I do it like in the docs of next.js https://nextjs.org/docs/app/building-your-application/authentication#optimistic-checks-with-middleware-optional
...
// 3. Decrypt the session from the cookie
const cookie = (await cookies()).get('session')?.value
...
...
// 3. Decrypt the session from the cookie
const cookie = (await cookies()).get('session')?.value
...
The cookie is then present.
22 replies
DTDrizzle Team
Created by peterstnsz on 6/1/2024 in #help
Supabase + Drizzle + Nuxt 3 + Node - SSL 'SELF_SIGNED_CERT_IN_CHAIN' and drizzle-kit studio issues
I using drizzle + ssl enforced. drizzle config
const caString = fs.readFileSync("xxx.crt").toString();
// URL encode the certificate
const caStringEncoded = encodeURIComponent(caString);

// Construct the database URL with SSL parameters
const dbUrl = new URL(env.DB_URL!);
dbUrl.searchParams.append("sslmode", "require");
dbUrl.searchParams.append("sslrootcert", caStringEncoded);

export default defineConfig({
dialect: "postgresql",
out: "./drizzle",
schema: "./db/schema/*",
dbCredentials: {
url: dbUrl.toString(),
},
schemaFilter: ["public"],
});
const caString = fs.readFileSync("xxx.crt").toString();
// URL encode the certificate
const caStringEncoded = encodeURIComponent(caString);

// Construct the database URL with SSL parameters
const dbUrl = new URL(env.DB_URL!);
dbUrl.searchParams.append("sslmode", "require");
dbUrl.searchParams.append("sslrootcert", caStringEncoded);

export default defineConfig({
dialect: "postgresql",
out: "./drizzle",
schema: "./db/schema/*",
dbCredentials: {
url: dbUrl.toString(),
},
schemaFilter: ["public"],
});
file for drizzle db
...
const connectionString = process.env.DB_URL!;
const client = postgres(connectionString, {
ssl: {
rejectUnauthorized: true,
ca: fs.readFileSync("xxx").toString(),
},
});
...
...
const connectionString = process.env.DB_URL!;
const client = postgres(connectionString, {
ssl: {
rejectUnauthorized: true,
ca: fs.readFileSync("xxx").toString(),
},
});
...
5 replies