fix: strengthen password security - increase bcrypt rounds to 14, add notNull constraint to password field, add pull_policy to docker-compose
This commit is contained in:
@@ -3,6 +3,7 @@ services:
|
|||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
container_name: wishlist-postgres
|
container_name: wishlist-postgres
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
pull_policy: always
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: ${POSTGRES_USER}
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const users = pgTable('user', {
|
|||||||
email: text('email').unique(),
|
email: text('email').unique(),
|
||||||
emailVerified: timestamp('emailVerified', { mode: 'date' }),
|
emailVerified: timestamp('emailVerified', { mode: 'date' }),
|
||||||
image: text('image'),
|
image: text('image'),
|
||||||
password: text('password'),
|
password: text('password').notNull(),
|
||||||
username: text('username').unique(),
|
username: text('username').unique(),
|
||||||
dashboardTheme: text('dashboard_theme').default('none'),
|
dashboardTheme: text('dashboard_theme').default('none'),
|
||||||
dashboardColor: text('dashboard_color'),
|
dashboardColor: text('dashboard_color'),
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export const actions: Actions = {
|
|||||||
return fail(400, { error: 'Username already taken', name, username });
|
return fail(400, { error: 'Username already taken', name, username });
|
||||||
}
|
}
|
||||||
|
|
||||||
const hashedPassword = await bcrypt.hash(password, 10);
|
const hashedPassword = await bcrypt.hash(password, 14);
|
||||||
|
|
||||||
await db.insert(users).values({
|
await db.insert(users).values({
|
||||||
name: sanitizedName,
|
name: sanitizedName,
|
||||||
|
|||||||
Reference in New Issue
Block a user