DragonCoder99
DragonCoder99
Explore posts from servers
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