Skip to content

Commit 3c6d68b

Browse files
committed
add description errors in checkToken hook
1 parent da5de89 commit 3c6d68b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/hooks/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export const checkToken = async <A, B, C, RouteGeneric> (req: FastifyRequest<Rou
1818
if (token) {
1919
const {rows} = await server.pg.query('select user_id from root.users_access where token=$1 AND expires > current_timestamp', [token]);
2020
if (!rows.length) {
21-
reply.status(401).send();
21+
reply.status(401).send('the token is invalid or expired');
2222
return reply;
2323
}
2424
req.headers.userId = rows[0].user_id;//todo проверить что отдается в ответе от сервера
2525
} else {
26-
reply.status(401).send();
26+
reply.status(401).send('the token was not transferred');
2727
return reply;
2828
}
2929
};

0 commit comments

Comments
 (0)