Skip to content

Commit

Permalink
fix: update authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
kpostekk committed Sep 17, 2023
1 parent 22d9151 commit 412eede
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/nest/src/auth/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ export class ScraperGuard implements CanActivate {
throw new UnauthorizedException()
}

const connectionParams = context.req.connectionParams || context.req.headers
const headersLike = context.req.connectionParams || context.req.headers

// const connectionParams = (context.request || context.req) as FastifyRequest
const authorization = connectionParams.Authorization || connectionParams.authorization
const authorization = headersLike.authorization || headersLike.Authorization

console.log(JSON.stringify({ headersLike }, null, 2))

if (!authorization) throw new UnauthorizedException()

Expand Down
2 changes: 1 addition & 1 deletion packages/scrapy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ yargs(hideBin(process.argv))
headers: {
authorization: `Bearer ${usedToken}`,
},
// fetch,
fetch,
})

// eslint-disable-next-line no-constant-condition
Expand Down

0 comments on commit 412eede

Please sign in to comment.