next-auth drizzle adapter customization
Hi folks,
I'm using t3 app dir stack with next-auth and drizzle. I wanna customize the drizzle adapter while creating a user. I inspected the source code and customized the createUser callback function of the adapter as the following:
I have extended my users table by adding password and email columns and need to set the username column with notNull restriction using the email without domain like you see above.
the problem is that the username value still gets null somehow even though the email is not null so I can't add users since the notNull restriction error.
It seems that my changes doesn't work at all, how do I customize this adapter as I need ?
5 Replies
I solved it creating my own adapter instead of changing the source code. The username gets what I expected above.
hey man, im having trouble with this too, mind sharing your solution?
GitHub
Turkish-Dictionary/db/CustomDrizzleAdapter.ts at 4Furki4/issue55 · ...
Turkish Dictionary is an open-source website where people can search and save words, and contribute to Turkish! - 4Furki4/Turkish-Dictionary
I also extended my AdapterUser and User interfaces in auth.ts: https://github.com/4Furki4/Turkish-Dictionary/blob/0354e677d4fd57c3b927777ee3756a67d0348503/src/server/auth.ts#L39
GitHub
Turkish-Dictionary/src/server/auth.ts at 0354e677d4fd57c3b927777ee3...
Turkish Dictionary is an open-source website where people can search and save words, and contribute to Turkish! - 4Furki4/Turkish-Dictionary
hey dude@skuse
did my code do the trick for you ?