How to use the @verdaccio/commons-api.getInternalError function in @verdaccio/commons-api

To help you get started, we’ve selected a few @verdaccio/commons-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github verdaccio / verdaccio / test / unit / modules / plugin / auth.spec.ts View on Github external
test('should be a fail on login', () => {
        const config: Config = new AppConfig(_.cloneDeep(authPluginFailureConf));
        const auth: IAuth = new Auth(config);

        expect(auth).toBeDefined();

        const callback = jest.fn();

        auth.authenticate('foo', 'bar', callback);
        expect(callback).toHaveBeenCalledTimes(1);
        expect(callback).toHaveBeenCalledWith(getInternalError());
      });
    });
github bufferoverflow / verdaccio-gitlab / src / gitlab.ts View on Github external
changePassword(user: string, password: string, newPassword: string, cb: Callback) {
    this.logger.trace(`[gitlab] changePassword called for user: ${user}`);
    return cb(getInternalError('You are using verdaccio-gitlab integration. Please change your password in gitlab'));
  }