fix: accept token as query param in authenticate, pass token to oauth link URL

This commit is contained in:
Kirill
2026-05-22 13:52:48 +05:00
parent d51266446f
commit 22282c5f4e
3 changed files with 9 additions and 1 deletions
Binary file not shown.
+3
View File
@@ -75,6 +75,9 @@ await fastify.register(fastifyStatic, {
fastify.decorate('authenticate', async function authenticate(request, reply) {
try {
if (!request.headers.authorization && request.query?.token) {
request.headers.authorization = `Bearer ${request.query.token}`
}
await request.jwtVerify()
} catch {
return reply.code(401).send({ error: 'Не авторизован' })