mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-22 18:29:26 +00:00
refactor: server: auth: destructure
This commit is contained in:
parent
dff0267239
commit
da0e99ad8c
2 changed files with 5 additions and 4 deletions
|
|
@ -16,8 +16,9 @@ module.exports = (config) => {
|
|||
|
||||
function _middle(config, authentication, req, res, next) {
|
||||
const is = config('auth');
|
||||
const {originalUrl} = req;
|
||||
|
||||
if (!is || req.originalUrl.startsWith("/public/"))
|
||||
if (!is || originalUrl.startsWith('/public/'))
|
||||
return next();
|
||||
|
||||
const success = () => next();
|
||||
|
|
|
|||
|
|
@ -186,12 +186,12 @@ test('cloudcmd: manifest.json', async (t) => {
|
|||
|
||||
const options = {
|
||||
config,
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
const {status} = await request.get('/public/manifest.json', {
|
||||
options,
|
||||
});
|
||||
|
||||
|
||||
t.equal(status, 200, 'should return manifest.json even when authentication is enabled');
|
||||
t.end();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue