DN_Dev
DN_Dev
Explore posts from servers
BABetter Auth
Created by DN_Dev on 4/23/2025 in #help
Session Caching with Custom Fields Workaround
I've been using Next Auth and was thinking to switch over, however the line below is making me hesitate. I do not want to hit the db on every request, but I also want to use custom fields such as roles. Is there an alternative or work around for this?
Session caching, including secondary storage or cookie cache, does not include custom fields. Each time the session is fetched, your custom session function will be called.
Session caching, including secondary storage or cookie cache, does not include custom fields. Each time the session is fetched, your custom session function will be called.
13 replies
DTDrizzle Team
Created by DN_Dev on 1/2/2024 in #help
Foreign Key - On Delete
When using .references(() => id, {onDelete: 'cascade'}) however it doesn't seem like there's a similar option using extraConfig option, which I use mainly to name my foreign keys.
(table) => ({
reference: foreignKey({
columns: [table.some_id],
foreignColumns: [some.id],
name: 'some_id_fk',
}),
})
(table) => ({
reference: foreignKey({
columns: [table.some_id],
foreignColumns: [some.id],
name: 'some_id_fk',
}),
})
Can anyone confirm? Otherwise I'd have to manually overwrite migrations I guess
3 replies