eelkevdbos / elysia-basic-auth Goto Github PK
View Code? Open in Web Editor NEWBasic auth plugin for Elysiajs
License: MIT License
Basic auth plugin for Elysiajs
License: MIT License
Hello!
Firstly, a huge thanks for this project โ the time and effort you've put into making sure this is really well thought out with awesome tests and a proper security mindset is amazing. We're really grateful and plan to use this in a new project.
I've tried to set up a Elysia 0.8.9 project with this package, however the server fails to start as soon as I add basicAuth
as middleware with the following error:
TypeError: app.state("basicAuthRealm", null).state("basicAuthUser", null).addError is not a function. (In 'app.state("basicAuthRealm", null).state("basicAuthUser", null).addError({ BASIC_AUTH_ERROR: BasicAuthError })', 'app.state("basicAuthRealm", null).state("basicAuthUser", null).addError' is undefined)
at /<redacted>/node_modules/@eelkevdbos/elysia-basic-auth/dist/index.js:102:10
at _use (/<redacted>/node_modules/elysia/dist/bun/index.js:361:32813)
at /<redacted>/src/index.ts:7:20
97 | };
98 | const credentialsMap = newCredentialsMap(options.credentials);
99 | const inScope = newScopePredicate(options.scope);
100 | const skipRequest = (request) => options.skipCorsPreflight && isCORSPreflightRequest(request);
101 | return (app) => app
102 | .state('basicAuthRealm', null)
^
It appears as though despite the fact there is a peerDependency
on ^0.8.1
the actual bun.lockb
contains 0.6.16
:
$ bun pm ls
elysia-basic-auth node_modules (11)
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
In Elysia 0.7.0
, addError
was renamed to error
which I think is the root cause of the above issue.
I have prepared a small PR fix for this, which I will link to this issue shortly.
If not filled in, there will be no pop-up window
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.