Unable to set user ID using databaseHooks

Hey guys, I'm trying to set the user id using databaseHooks:
databaseHooks: {
user: {
create: {
before: async (user, ctx) => {
return {
data: {
user: {
...user,
id: "123",
},
},
};
},
},
},
}
databaseHooks: {
user: {
create: {
before: async (user, ctx) => {
return {
data: {
user: {
...user,
id: "123",
},
},
};
},
},
},
}
but it just keeps getting overridden. Is there a way to do this?
3 Replies
Geospace
GeospaceOP2mo ago
anyone know if this is possible?
bekacru
bekacru2mo ago
you can set generateId:false but we probably should allow this
Geospace
GeospaceOP2mo ago
not sure how many people are using non-standard primary keys but yeah i think it would be super useful by the way, would you find any value in a native swift ui package for betterauth? I'm not sure if it's necessary (haven't gotten around to trying to integrate my swift app with betterauth yet), but if a native solution would be clearly useful let me know, i might be able to dedicate some time to building one

Did you find this page helpful?