Skip to content

Commit

Permalink
update dependents
Browse files Browse the repository at this point in the history
  • Loading branch information
helloyou2012 committed May 21, 2019
1 parent 6d01650 commit 2f325a3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 39 deletions.
62 changes: 31 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "npm run build-app && npm run build-assets",
"build-app": "rimraf app && babel src --out-dir app",
"build-assets": "rimraf public && cd assets && dool build -o $PWD/../public",
"prepublish": "npm run build",
"prepare": "npm run build",
"test": "NODE_ENV=test nyc mocha --exit",
"report": "nyc report --reporter=html",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
Expand Down Expand Up @@ -51,52 +51,52 @@
"node": ">= 8"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/cli": "^7.4.4",
"@babel/node": "^7.2.2",
"@babel/register": "^7.0.0",
"@babel/register": "^7.4.4",
"babel-eslint": "^10.0.1",
"babel-plugin-add-module-exports": "^1.0.0",
"babel-plugin-istanbul": "^5.1.0",
"bootstrap": "^3.4.0",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-istanbul": "^5.1.4",
"bootstrap": "^3.4.1",
"chai": "^4.2.0",
"chai-http": "^4.2.0",
"coveralls": "^3.0.0",
"dool": "^4.1.1",
"eslint": "^5.11.1",
"chai-http": "^4.3.0",
"coveralls": "^3.0.3",
"dool": "^4.1.3",
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-node": "^9.0.1",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0",
"jquery": "^3.1.0",
"koa-passport": "^4.1.1",
"mocha": "^5.2.0",
"mysql2": "^1.6.4",
"nyc": "^13.1.0",
"passport-oauth2": "^1.3.0",
"jquery": "^3.4.1",
"koa-passport": "^4.1.3",
"mocha": "^6.1.4",
"mysql2": "^1.6.5",
"nyc": "^14.1.1",
"passport-oauth2": "^1.5.0",
"pre-commit": "^1.1.3",
"rimraf": "^2.5.4",
"sqlite3": "^4.0.4"
"rimraf": "^2.6.3",
"sqlite3": "^4.0.8"
},
"dependencies": {
"commander": "^2.19.0",
"inquirer": "^6.2.1",
"koa": "^2.6.2",
"commander": "^2.20.0",
"inquirer": "^6.3.1",
"koa": "^2.7.0",
"koa-bodyparser": "^4.2.1",
"koa-csrf": "^3.0.6",
"koa-csrf": "^3.0.7",
"koa-logger": "^3.2.0",
"koa-orm": "^2.3.1",
"koa-orm": "^2.3.3",
"koa-router": "^7.4.0",
"koa-session": "^5.10.1",
"koa-session": "^5.12.0",
"koa-static": "^5.0.0",
"koa-view": "^2.1.2",
"koa-view": "^2.1.3",
"lodash.merge": "^4.6.0",
"lodash.template": "^4.4.0",
"nodemailer": "^4.7.0",
"nodemailer": "^6.1.1",
"notp": "^2.0.3",
"qr-image": "^3.1.0",
"randomcolor": "^0.5.3",
"randomcolor": "^0.5.4",
"thirty-two": "^1.0.2",
"validator": "^10.10.0"
"validator": "^10.11.0"
}
}
2 changes: 1 addition & 1 deletion src/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export async function sendTotp (ctx) {
});
// send email
if (res[0]) {
const user = await User.findById(id);
const user = await User.findByPk(id);
await ctx.sendMail(user.email, 'send_totp', {
username: user.email,
cid: 'key',
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export async function passwordChangePage (ctx) {
return;
}

const code = await EmailCode.findById(codeId);
const code = await EmailCode.findByPk(codeId);
if (!code) {
ctx.flash('error', 'Code is invalid');
ctx.redirect(ctx._routes.password_reset);
Expand Down Expand Up @@ -179,7 +179,7 @@ export async function passwordChange (ctx) {
return;
}

const code = await EmailCode.findById(codeId);
const code = await EmailCode.findByPk(codeId);
if (!code) {
ctx.flash('error', 'Code is invalid');
ctx.redirect(ctx._routes.password_reset);
Expand Down Expand Up @@ -215,7 +215,7 @@ export async function passwordChange (ctx) {
export async function getInfo (ctx) {
const { User } = ctx.orm();

ctx.body = await User.findById(ctx._userId, {
ctx.body = await User.findByPk(ctx._userId, {
attributes: ['id', 'email'],
raw: true
});
Expand Down
8 changes: 4 additions & 4 deletions src/oauth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function (config) {

ctx.assert(client_id, 400, 'client_id is missing.');

const client = await Client.findById(client_id);
const client = await Client.findByPk(client_id);

ctx.assert(client, 401, 'client_id is invalid.');

Expand Down Expand Up @@ -48,12 +48,12 @@ export default function (config) {
ctx.assert(redirect_uri, 400, 'redirect_uri is missing.');
ctx.assert(code, 400, 'code is missing.');

const client = await Client.findById(client_id);
const client = await Client.findByPk(client_id);

ctx.assert(client, 401, 'client_id is invalid.');
ctx.assert(client.secret === client_secret, 401, 'client_secret is invalid.');

const _code = await Code.findById(code);
const _code = await Code.findByPk(code);

ctx.assert(_code, 401, 'code is invalid.');

Expand Down Expand Up @@ -92,7 +92,7 @@ export default function (config) {

ctx.assert(tokenId, 400, 'access_token is missing.');

const token = await Token.findById(tokenId);
const token = await Token.findByPk(tokenId);

ctx.assert(token, 401, 'access_token is invalid.');

Expand Down

0 comments on commit 2f325a3

Please sign in to comment.