File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
packages/better-auth/src/db Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,16 @@ export const createInternalAdapter = (
2424 createOAuthUser : async ( user : User , account : Omit < Account , "userId" > ) => {
2525 try {
2626 const createdUser = await createWithHooks ( user , "user" ) ;
27- const createdAccount = await createWithHooks ( account , "account" ) ;
28- return {
29- user : createdUser ,
30- account : {
31- ...createdAccount ,
27+ const createdAccount = await createWithHooks (
28+ {
29+ ...account ,
3230 userId : createdUser . id || user . id ,
3331 } ,
32+ "account" ,
33+ ) ;
34+ return {
35+ user : createdUser ,
36+ account : createdAccount ,
3437 } ;
3538 } catch ( e ) {
3639 console . log ( e ) ;
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export function getWithHooks(
4747 ? await adapter . create < T > ( {
4848 model : table . tableName ,
4949 data : {
50- id : generateId ( ) ,
50+ id : actualData . id || generateId ( ) ,
5151 ...convertToDB ( table . fields , actualData ) ,
5252 } ,
5353 } )
You can’t perform that action at this time.
0 commit comments