refactor: minor changes
This commit is contained in:
@ -50,6 +50,7 @@ export const getUserById: FastifyPluginAsync = async (fastify) => {
|
||||
id: true,
|
||||
name: true,
|
||||
email: settings.isPublicEmail,
|
||||
isConfirmed: true,
|
||||
logo: true,
|
||||
status: true,
|
||||
biography: true,
|
||||
|
@ -80,8 +80,8 @@ export default fastifyPlugin(
|
||||
emitToAuthorizedUsers,
|
||||
emitToMembers
|
||||
}
|
||||
await fastify.decorate('io', io)
|
||||
await fastify.addHook('onClose', (fastify) => {
|
||||
fastify.decorate('io', io)
|
||||
fastify.addHook('onClose', (fastify) => {
|
||||
fastify.io.instance.close()
|
||||
})
|
||||
},
|
||||
|
@ -22,7 +22,7 @@ export const jwtSchema = {
|
||||
refreshToken: Type.String(),
|
||||
expiresIn: Type.Integer({
|
||||
description:
|
||||
'expiresIn is how long, in milliseconds, until the returned accessToken expires'
|
||||
'expiresIn is how long, in milliseconds, until the accessToken expires'
|
||||
}),
|
||||
type: Type.Literal('Bearer')
|
||||
}
|
||||
@ -30,9 +30,7 @@ export const jwtSchema = {
|
||||
export const expiresIn = ms(JWT_ACCESS_EXPIRES_IN)
|
||||
|
||||
export const generateAccessToken = (user: UserJWT): string => {
|
||||
return jwt.sign(user, JWT_ACCESS_SECRET, {
|
||||
expiresIn: JWT_ACCESS_EXPIRES_IN
|
||||
})
|
||||
return jwt.sign(user, JWT_ACCESS_SECRET, { expiresIn })
|
||||
}
|
||||
|
||||
export const generateRefreshToken = async (user: UserJWT): Promise<string> => {
|
||||
|
Reference in New Issue
Block a user