feat(lst): added in basic authentication
This commit is contained in:
10
packages/lst-auth/test/test.ts
Normal file
10
packages/lst-auth/test/test.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import app from "../index";
|
||||
|
||||
const request = new Request("http://localhost/protected", {
|
||||
headers: {
|
||||
Authorization: "Basic " + Buffer.from("admin:password12").toString("base64"),
|
||||
},
|
||||
});
|
||||
|
||||
const response = await app.fetch(request);
|
||||
console.log(await response.text()); // Should print "You are authenticated!"
|
||||
Reference in New Issue
Block a user