mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
f047cc8c25
* refactor: auth with legacy sign support refactor: auth with legacy sign support add tests add tests clean up lock fil clean up lock fil add more ci to test update ci update ci update ci update ci update ci * chore: add test for deprecated legacy signature * chore: add test for deprecated legacy signature * chore: add test for deprecated legacy signature * chore: add test for deprecated legacy signature * chore: add test for deprecated legacy signature
32 lines
790 B
JavaScript
32 lines
790 B
JavaScript
module.exports = function () {
|
|
return {
|
|
users: [],
|
|
authenticate(user, pass, callback) {
|
|
// https://verdaccio.org/docs/en/dev-plugins#onsuccess
|
|
// this is a successful login and return a simple group
|
|
callback(null, ['test']);
|
|
},
|
|
changePassword(user, password, newPassword, cb) {
|
|
if (password === newPassword) {
|
|
return cb(Error('error password equal'));
|
|
}
|
|
return cb(null, true);
|
|
},
|
|
adduser(user, password, cb) {
|
|
if (user === 'fail') {
|
|
return cb(Error('bad username'));
|
|
}
|
|
|
|
if (user === 'password') {
|
|
return cb(Error('bad password'));
|
|
}
|
|
|
|
if (user === 'skip') {
|
|
// if wants to the next plugin
|
|
return cb(null, false);
|
|
}
|
|
|
|
cb(null, true);
|
|
},
|
|
};
|
|
};
|