Skip to content

Commit

Permalink
chore: build
Browse files Browse the repository at this point in the history
  • Loading branch information
YuJianghao committed Apr 11, 2022
1 parent cd0331c commit aa89382
Show file tree
Hide file tree
Showing 154 changed files with 193 additions and 476 deletions.
11 changes: 3 additions & 8 deletions packages/server/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var tsyringe = require('tsyringe');
var fs = require('fs');
var JSONdb = require('simple-json-db');
var cryptoJs = require('crypto-js');
var httpErrors = require('http-errors');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

Expand Down Expand Up @@ -210,12 +211,6 @@ function install () {
}

var AccountService_1;
class BasicAuthError extends Error {
constructor() {
super(...arguments);
this.name = "BasicAuthError";
}
}
let AccountService = AccountService_1 = class AccountService {
constructor(_storage) {
this._storage = _storage;
Expand Down Expand Up @@ -257,10 +252,10 @@ let AccountService = AccountService_1 = class AccountService {
verify(username, password) {
const info = this._fromStorage();
if (username !== info.username) {
throw new BasicAuthError();
throw new httpErrors.Unauthorized();
}
if (this._encrypt(password) !== info.password) {
throw new BasicAuthError();
throw new httpErrors.Unauthorized();
}
}
};
Expand Down
Loading

0 comments on commit aa89382

Please sign in to comment.