Skip to content

Commit 54018d1

Browse files
committed
fix: Commented out user validation in authPlugin
1 parent a5c864f commit 54018d1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/velog-server/src/common/plugins/global/authPlugin.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { container } from 'tsyringe'
55
import { UserService } from '@services/UserService/index.js'
66
import { CookieService } from '@lib/cookie/CookieService.js'
77
import { Time } from '@constants/TimeConstants.js'
8-
import { DbService } from '@lib/db/DbService'
98

109
const authPlugin: FastifyPluginAsync = async (fastify) => {
1110
fastify.decorateRequest('user', null)
@@ -36,13 +35,13 @@ const authPlugin: FastifyPluginAsync = async (fastify) => {
3635
await userService.restoreToken({ request, reply })
3736
}
3837

39-
const user = await userService.findById(accessTokenData.user_id)
38+
// const user = await userService.findById(accessTokenData.user_id)
4039

41-
if (!user) {
42-
cookie.clearCookie(reply, 'access_token')
43-
cookie.clearCookie(reply, 'refresh_token')
44-
throw new Error('User not found')
45-
}
40+
// if (!user) {
41+
// cookie.clearCookie(reply, 'access_token')
42+
// cookie.clearCookie(reply, 'refresh_token')
43+
// throw new Error('User not found')
44+
// }
4645

4746
request.user = { id: accessTokenData.user_id }
4847
return

0 commit comments

Comments
 (0)