rhys
rhys
Explore posts from servers
BABetter Auth
Created by rhys on 4/24/2025 in #help
Cookies amongst multiple tenants, subdomains, and custom domains for a SaaS
Hey folks, I'm working on what is ultimately Squarespace for a niche, where users will get a unique subdomain, and can also add their own custom domain (so we have mycoolapp.com where i'll be serving the marketing, john.mycoolapp.com, and maryscoolapp.com). Looking for guidance on how to get it working with BetterAuth; my stack is SvelteKit, with Postgres + Drizzle (using the direct Postgres connector, though), with Directus as the CMS for end users. Currently I'm having an issue where the cookies are being set on the TLD and not working on the subdomains. I'm aware that there's an organisation plugin, but that doesn't look to have anything specific to sharing cookies between sites.
5 replies
BABetter Auth
Created by rhys on 4/21/2025 in #help
Cookies amongst multiple tenants, subdomains, and custom domains for a SaaS
Hey folks, I'm working on what is ultimately Squarespace for a niche, where users will get a unique subdomain, and can also add their own custom domain (so we have mycoolapp.com where i'll be serving the marketing, john.mycoolapp.com, and maryscoolapp.com). Looking for guidance on how to get it working with BetterAuth; my stack is SvelteKit, with Postgres + Drizzle (using the direct Postgres connector, though), with Directus as the CMS for end users. Currently I'm having an issue where the cookies are being set on the TLD and not working on the subdomains. I'm aware that there's an organisation plugin, but that doesn't look to have anything specific to sharing cookies between sites.
9 replies
BABetter Auth
Created by rhys on 4/12/2025 in #help
Output debug mode?
Is there any way to output more debugging stuff? I'm getting an error which is quite difficult to debug;
error PostgresError: column "undefined" does not exist
error PostgresError: column "undefined" does not exist
35 replies
BABetter Auth
Created by rhys on 4/9/2025 in #help
The field "id" does not exist in the "verification" schema
Hey guys, I'm trying to get Better Auth working with Directus, a headless CMS system. I'm having to hack around a little by manually creating the tables that there isn't an analog in Directus, and am having an issue with the verification table, which outputs
# SERVER_ERROR: [BetterAuthError: The field "id" does not exist in the "verification" schema. Please update your drizzle schema or re-generate using "npx @better-auth/cli generate".] {
cause: undefined
}
# SERVER_ERROR: [BetterAuthError: The field "id" does not exist in the "verification" schema. Please update your drizzle schema or re-generate using "npx @better-auth/cli generate".] {
cause: undefined
}
Introspecting my postgres db, this is the table that I've created;
export const verification = pgTable("verification", {
id: text().primaryKey().notNull(),
date_created: timestamp({ mode: 'string' }),
expires_at: timestamp({ mode: 'string' }).notNull(),
value: text().notNull(),
identifier: text(),
date_updated: timestamp({ mode: 'string' }),
});
export const verification = pgTable("verification", {
id: text().primaryKey().notNull(),
date_created: timestamp({ mode: 'string' }),
expires_at: timestamp({ mode: 'string' }).notNull(),
value: text().notNull(),
identifier: text(),
date_updated: timestamp({ mode: 'string' }),
});
Not sure what's wrong- it's complaining about the ID. How is the id created? Is it expecting it to be a uuid?
21 replies