Skip to content

Commit

Permalink
refactor: server: auth: destructure
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Nov 22, 2024
1 parent dff0267 commit da0e99a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion server/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions server/cloudcmd.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit da0e99a

Please sign in to comment.