elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
9.74k stars 207 forks source link

Bearer plugin doesn't work on Elysia 1.1.0-rc.9 #717

Closed ThatOneCalculator closed 1 month ago

ThatOneCalculator commented 1 month ago

What version of Elysia.JS is running?

1.1.0-rc.9

What platform is your computer?

Linux 6.9.8 x86_64 unknown

What steps can reproduce the bug?

import bearer from "@elysiajs/bearer";

// ...
new Elysia()
    .use(bearer())

What is the expected behavior?

Bearer plugin to work like how it does in 1.0.27

What do you see instead?

2845 | var randomId = () => crypto.getRandomValues(new Uint32Array(1))[0];
2846 | var deduplicateChecksum = (array) => {
2847 |   const hashes = [];
2848 |   for (let i = 0; i < array.length; i++) {
2849 |     const item = array[i];
2850 |     if (item.checksum) {
               ^
TypeError: undefined is not an object (evaluating 'item.checksum')
      at deduplicateChecksum (/home/kainoa/Git/inertia/node_modules/elysia/dist/index.mjs:2850:9)
      at _use (/home/kainoa/Git/inertia/node_modules/elysia/dist/index.mjs:6517:7)
      at /home/kainoa/Git/inertia/packages/backend/src/services/auth.ts:6:3

Additional information

No response

ThatOneCalculator commented 1 month ago

No longer an issue as of the 1.1.0 release!