Skip to content

Commit

Permalink
Update startCommand in services.yml and add password check in login f…
Browse files Browse the repository at this point in the history
…orm strategy (#7)
  • Loading branch information
ttizze authored Jul 14, 2024
1 parent a3f9abf commit 3889368
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
plan: free
region: singapore
buildCommand: bun run install-and-build
startCommand: npx prisma migrate deploy && bun run start
startCommand: bunx prisma migrate deploy && bunx prisma generate && bun run start
rootDir: web
envVars:
- key: DATABASE_URL
Expand Down
4 changes: 3 additions & 1 deletion web/app/utils/auth.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { FormStrategy } from 'remix-auth-form'
import { GoogleStrategy } from 'remix-auth-google'
import { prisma } from './prisma'
import { sessionStorage } from './session.server'
import { c } from 'node_modules/vite/dist/node/types.d-aGj9QkWt'

const SESSION_SECRET = process.env.SESSION_SECRET

Expand All @@ -29,6 +28,9 @@ const formStrategy = new FormStrategy(async ({ form }) => {
throw new AuthorizationError()
}

if (!user.password) {
throw new AuthorizationError('User has no password set.')
}
const passwordsMatch = await bcrypt.compare(String(password), user.password)

if (!passwordsMatch) {
Expand Down

0 comments on commit 3889368

Please sign in to comment.