ilya
ilya
Explore posts from servers
BABetter Auth
Created by ilya on 3/11/2025 in #help
Is there a way to customize userCreate function to populate additional field?
Anyone looking for a solution, here is how it's done
user: {
modelName: 'UsersView',
fields: {
name: 'firstName',
email: 'email',
image: 'avatarUrl',
},
additionalFields: {
userId: {
type: 'string',
},
subscriptionStatus: {
type: 'string',
},
primaryProvider: {
type: 'string',
},
},
},
databaseHooks: {
user: {
create: {
before: async (user) => {
const userId = generateId(24);
return {
data: {
...user,
id: userId,
userId, // id alias
subscriptionStatus: SubscriptionStatus.FREE,
primaryProvider: IdentityProvider.email,
},
};
},
},
},
},
user: {
modelName: 'UsersView',
fields: {
name: 'firstName',
email: 'email',
image: 'avatarUrl',
},
additionalFields: {
userId: {
type: 'string',
},
subscriptionStatus: {
type: 'string',
},
primaryProvider: {
type: 'string',
},
},
},
databaseHooks: {
user: {
create: {
before: async (user) => {
const userId = generateId(24);
return {
data: {
...user,
id: userId,
userId, // id alias
subscriptionStatus: SubscriptionStatus.FREE,
primaryProvider: IdentityProvider.email,
},
};
},
},
},
},
4 replies
BABetter Auth
Created by ilya on 3/10/2025 in #help
Error with custom field mapping. whereClause id getting undefined value
Anyone looking for a solution, here is how it's done
user: {
modelName: 'UsersView',
fields: {
name: 'firstName',
email: 'email',
image: 'avatarUrl',
},
additionalFields: {
userId: {
type: 'string',
},
subscriptionStatus: {
type: 'string',
},
primaryProvider: {
type: 'string',
},
},
},
databaseHooks: {
user: {
create: {
before: async (user) => {
const userId = generateId(24);
return {
data: {
...user,
id: userId,
userId, // id alias
subscriptionStatus: SubscriptionStatus.FREE,
primaryProvider: IdentityProvider.email,
},
};
},
},
},
},
user: {
modelName: 'UsersView',
fields: {
name: 'firstName',
email: 'email',
image: 'avatarUrl',
},
additionalFields: {
userId: {
type: 'string',
},
subscriptionStatus: {
type: 'string',
},
primaryProvider: {
type: 'string',
},
},
},
databaseHooks: {
user: {
create: {
before: async (user) => {
const userId = generateId(24);
return {
data: {
...user,
id: userId,
userId, // id alias
subscriptionStatus: SubscriptionStatus.FREE,
primaryProvider: IdentityProvider.email,
},
};
},
},
},
},
7 replies
BABetter Auth
Created by ilya on 3/11/2025 in #help
Is there a way to customize userCreate function to populate additional field?
Will run the built in userCreate first and then add an additional field in a second call or will it enrich the payload of the initial user create call?
4 replies
BABetter Auth
Created by ilya on 3/10/2025 in #help
Error with custom field mapping. whereClause id getting undefined value
A Before Hook maybe?
7 replies
BABetter Auth
Created by ilya on 3/10/2025 in #help
Error with custom field mapping. whereClause id getting undefined value
No description
7 replies
BABetter Auth
Created by ilya on 3/10/2025 in #help
Error with custom field mapping. whereClause id getting undefined value
No description
7 replies
BABetter Auth
Created by ilya on 3/10/2025 in #help
Error with custom field mapping. whereClause id getting undefined value
version "better-auth": "^1.2.3",
7 replies
PPrisma
Created by ilya on 2/25/2025 in #help-and-questions
Migration from 5 to 6 for serverless project
Thank you for your reply! @Nurul (Prisma) If Prisma gets rid of binaries it would be no brainer for any serverless app
5 replies