Skip to content

Commit da0e99a

Browse files
committed
refactor: server: auth: destructure
1 parent dff0267 commit da0e99a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

server/auth.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ module.exports = (config) => {
1616

1717
function _middle(config, authentication, req, res, next) {
1818
const is = config('auth');
19+
const {originalUrl} = req;
1920

20-
if (!is || req.originalUrl.startsWith("/public/"))
21+
if (!is || originalUrl.startsWith('/public/'))
2122
return next();
2223

2324
const success = () => next();

server/cloudcmd.spec.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ test('cloudcmd: manifest.json', async (t) => {
186186

187187
const options = {
188188
config,
189-
};
190-
189+
};
190+
191191
const {status} = await request.get('/public/manifest.json', {
192192
options,
193193
});
194-
194+
195195
t.equal(status, 200, 'should return manifest.json even when authentication is enabled');
196196
t.end();
197197
});

0 commit comments

Comments
 (0)