apps/api: read token from headers

This commit is contained in:
vchikalkin 2023-11-17 12:29:02 +03:00
parent 6e323803bd
commit 1a7cf3f3c5

View File

@ -11,7 +11,7 @@ export class AppController {
@Get('auth')
public async auth(@Req() req: FastifyRequest, @Res() reply: FastifyReply) {
try {
const token = req.cookies[env.COOKIE_TOKEN_NAME];
const token = req.cookies[env.COOKIE_TOKEN_NAME] || req.headers.authorization.split(' ')[1];
this.appService.checkToken(token);