DragonCoder99
DragonCoder99
Explore posts from servers
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
I'm on it thanks for all your help @lonelyplanet !!!
26 replies
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
yep indeed I need to migrate and only got the hashed version of the passwords
26 replies
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
yeah will try to do it with Drizzle it self
26 replies
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
yeah kinda what the first answer told me to do 😦
26 replies
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
That didn't help I still get errors on my "body" in the better-auth functions.
await auth.api.signUpEmail({
// here typescript get mad on me, for not including all the fields...
body: {
password: "1PASS23456",
name: "Testing Tester",
},
});
await auth.api.signUpEmail({
// here typescript get mad on me, for not including all the fields...
body: {
password: "1PASS23456",
name: "Testing Tester",
},
});
26 replies
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
I tried using the additional fields, but it wants be to included all those fields every time every time; otherwise, I get a type error.
export const auth = betterAuth({
...stuff,
user: {
additionalFields: {
oldId: {
type: "string",
nullable: true,
optional: true,
},
oldFormat: {
type: "boolean",
defaultValue: false,
optional: true,
},
firstName: {
type: "string",
nullable: true,
optional: true,
},
lastName: {
type: "string",
nullable: true,
optional: true,
},
phone: {
type: "string",
nullable: true,
optional: true,
},
zipCode: {
type: "string",
nullable: true,
optional: true,
},
defaultTip: {
type: "number",
defaultValue: 0,
optional: true,
},
defaultPaymentType: {
type: "string",
defaultValue: "cash",
optional: true,
},
town: {
type: "string",
defaultValue: "Brooklyn",
optional: true,
},
isBusiness: {
type: "boolean",
defaultValue: false,
optional: true,
},
businessName: {
type: "string",
nullable: true,
optional: true,
},
businessType: {
type: "string",
nullable: true,
optional: true,
},
isAccountSetupComplete: {
type: "boolean",
defaultValue: false,
optional: true,
},
adminNotes: {
type: "string",
nullable: true,
optional: true,
},
},
deleteUser: {
enabled: false,
},
},
plugins: [admin(), twoFactor(), nextCookies()],
});
export const auth = betterAuth({
...stuff,
user: {
additionalFields: {
oldId: {
type: "string",
nullable: true,
optional: true,
},
oldFormat: {
type: "boolean",
defaultValue: false,
optional: true,
},
firstName: {
type: "string",
nullable: true,
optional: true,
},
lastName: {
type: "string",
nullable: true,
optional: true,
},
phone: {
type: "string",
nullable: true,
optional: true,
},
zipCode: {
type: "string",
nullable: true,
optional: true,
},
defaultTip: {
type: "number",
defaultValue: 0,
optional: true,
},
defaultPaymentType: {
type: "string",
defaultValue: "cash",
optional: true,
},
town: {
type: "string",
defaultValue: "Brooklyn",
optional: true,
},
isBusiness: {
type: "boolean",
defaultValue: false,
optional: true,
},
businessName: {
type: "string",
nullable: true,
optional: true,
},
businessType: {
type: "string",
nullable: true,
optional: true,
},
isAccountSetupComplete: {
type: "boolean",
defaultValue: false,
optional: true,
},
adminNotes: {
type: "string",
nullable: true,
optional: true,
},
},
deleteUser: {
enabled: false,
},
},
plugins: [admin(), twoFactor(), nextCookies()],
});
26 replies
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
No worries and thanks!
26 replies
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
Hashed ofcourse it are passwords
26 replies
BABetter Auth
Created by DragonCoder99 on 3/25/2025 in #help
Help with Seeding Existing Users into Better Auth
Wouldn't that end up re-encrypting the already encrypted passwords, rendering them unusable?! 😦
26 replies
BABetter Auth
Created by DragonCoder99 on 2/18/2025 in #help
Using BcryptJS with Better-Auth
thanks! 🙂
7 replies
BABetter Auth
Created by DragonCoder99 on 2/18/2025 in #help
Using BcryptJS with Better-Auth
import bcrypt from "bcryptjs";

// To hash a password:
const salt = bcrypt.genSaltSync(10);
const hash = bcrypt.hashSync("pass123", salt);

// To verify a password:
bcrypt.compareSync("pass123", hash); // true
bcrypt.compareSync("wrong_pass", hash); // false
import bcrypt from "bcryptjs";

// To hash a password:
const salt = bcrypt.genSaltSync(10);
const hash = bcrypt.hashSync("pass123", salt);

// To verify a password:
bcrypt.compareSync("pass123", hash); // true
bcrypt.compareSync("wrong_pass", hash); // false
7 replies
BABetter Auth
Created by DragonCoder99 on 2/18/2025 in #help
Using BcryptJS with Better-Auth
it doesn't give a full example... but it got me closer but not sure how to write those functions for bcryptjs as they need input and so on.
import { betterAuth } from "better-auth"
import bcrypt from "bcryptjs";

export const auth = betterAuth({
//...rest of the options
emailAndPassword: {
password: {
hash: // your custom password hashing function
verify: // your custom password verification function
}
}
})
import { betterAuth } from "better-auth"
import bcrypt from "bcryptjs";

export const auth = betterAuth({
//...rest of the options
emailAndPassword: {
password: {
hash: // your custom password hashing function
verify: // your custom password verification function
}
}
})
7 replies
DTDrizzle Team
Created by DragonCoder99 on 10/18/2024 in #help
Using UUID v7 with Drizzle?
Thanks 👍
3 replies
DTDrizzle Team
Created by DragonCoder99 on 10/6/2024 in #help
pgEnum + Neon migrations type error
It follows the Auth.js setup but just got account and users
8 replies
DTDrizzle Team
Created by DragonCoder99 on 10/6/2024 in #help
pgEnum + Neon migrations type error
There is a 2nd table accounts
8 replies
DTDrizzle Team
Created by DragonCoder99 on 10/6/2024 in #help
pgEnum + Neon migrations type error
Yep I didn't put it in my app yet I was just trying to setup the roles in my table I double checked and the only references to roles is in this file
8 replies