Skip to content

Commit

Permalink
fix: restore error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
@jotadeveloper authored and sergiohgz committed Jul 31, 2019
1 parent f3abedd commit 5d241b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/auth-memory/src/Memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export default class Memory implements IPluginAuth<VerdaccioMemoryConfig> {
}

if (!user.name) {
const err = getForbidden('name field is mandatory, please define a name for each user');
this._logger.debug({ user: user.name }, 'user: @{user} name field is mandatory, please define a name for each user');
const err = getForbidden('not allowed to publish package');
this._logger.debug({ user: user.name }, 'user: @{user} not allowed to publish package');

return cb(err);
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/auth-memory/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('Memory', function() {
// $FlowFixMe
auth.allow_publish({}, { publish: [], proxy: [], access: [] }, function(err, groups) {
expect(err).not.toBeNull();
expect(err.message).toMatch(/name field is mandatory, please define a name for each user/);
expect(err.message).toMatch(/not allowed to publish package/);
done();
});
});
Expand All @@ -197,7 +197,7 @@ describe('Memory', function() {
// $FlowFixMe
auth.allow_publish({}, { publish: ['anyOtherUser'], proxy: [], access: [] }, function(err, groups) {
expect(err).not.toBeNull();
expect(err.message).toMatch(/name field is mandatory, please define a name for each user/);
expect(err.message).toMatch(/not allowed to publish package/);
done();
});
});
Expand Down

0 comments on commit 5d241b6

Please sign in to comment.