Skip to content

Commit

Permalink
Bypass authentication for non-mobiscroll packages (temporary)
Browse files Browse the repository at this point in the history
  • Loading branch information
Halmen Istvan committed Sep 22, 2023
1 parent 499f40a commit 215210c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ class Auth implements IAuth {
const user: string = credentials.slice(0, index);
const pass: string = credentials.slice(index + 1);

// Bypass authentication in case of other npm packages (temporary solution)
const pathname = (req._parsedUrl || {}).pathname;
if (!/@mobiscroll/.test(pathname) && !/^\/\-\//.test(pathname)) {
return next();
}

this.authenticate(user, pass, function(err, user) {
if (!err) {
req.remote_user = user;
Expand Down

0 comments on commit 215210c

Please sign in to comment.