Update dependencies
This commit is contained in:
parent
1158db6d7e
commit
5a7e695e53
10 changed files with 864 additions and 870 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
|||
node_modules
|
|
@ -20,7 +20,7 @@ export default async (ctx, next) => {
|
|||
const userToken = await ctx.redis.get(ctx.req.headers.authorization.substr(1));
|
||||
ctx.assert(userToken, 401, '{"error": {"message": "Invalid token.", "code": 606}}');
|
||||
debug('Token found');
|
||||
user = await models.user.findById(userToken);
|
||||
user = await models.user.findByPk(userToken);
|
||||
if (!user) {
|
||||
login.save();
|
||||
return;
|
||||
|
|
|
@ -29,7 +29,7 @@ export async function create(ctx) {
|
|||
|
||||
delete customer.subscriptions;
|
||||
|
||||
const user = await models.user.findById(ctx.user.id);
|
||||
const user = await models.user.findByPk(ctx.user.id);
|
||||
user.plan = 'Pro';
|
||||
await user.save();
|
||||
|
||||
|
@ -69,7 +69,7 @@ export async function create(ctx) {
|
|||
}
|
||||
|
||||
export async function cancel(ctx) {
|
||||
const user = await models.user.findById(ctx.user.id);
|
||||
const user = await models.user.findByPk(ctx.user.id);
|
||||
const transactions = await user.getTransactions();
|
||||
const transaction = transactions[0];
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ export async function settings(ctx) {
|
|||
ctx.request.body.current_password, 400,
|
||||
'{"error": {"message": "Current Password required to update account.", "code": 612}}',
|
||||
);
|
||||
const user = await models.user.findById(ctx.user.id);
|
||||
const user = await models.user.findByPk(ctx.user.id);
|
||||
ctx.assert(
|
||||
await passwords.match(ctx.request.body.current_password, user.password), 400,
|
||||
'{"error": {"message": "Incorrect password", "code": 606}}',
|
||||
|
|
|
@ -25,7 +25,7 @@ services:
|
|||
VIRUSTOTAL_KEY:
|
||||
SENTRY_DSN:
|
||||
volumes:
|
||||
- ./:/app:cached
|
||||
- ./:/app
|
||||
- uploads:/hostr/uploads
|
||||
- export:/export
|
||||
ports:
|
||||
|
@ -55,7 +55,7 @@ services:
|
|||
VIRUSTOTAL_KEY:
|
||||
SENTRY_DSN:
|
||||
volumes:
|
||||
- ./:/app:cached
|
||||
- ./:/app
|
||||
- uploads:/hostr/uploads
|
||||
ports:
|
||||
- "3001:3000"
|
||||
|
|
|
@ -14,7 +14,7 @@ async function checkId(Files, fileId, attempts) {
|
|||
if (attempts > 10) {
|
||||
return false;
|
||||
}
|
||||
const file = await models.file.findById(fileId);
|
||||
const file = await models.file.findByPk(fileId);
|
||||
if (file === null) {
|
||||
return fileId;
|
||||
}
|
||||
|
|
10
package.json
10
package.json
|
@ -25,7 +25,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@sendgrid/mail": "^6.3.1",
|
||||
"@sentry/node": "^4.5.3",
|
||||
"@sentry/node": "^5.4.0",
|
||||
"angular": "^1.7.7",
|
||||
"angular-reconnecting-websocket": "https://github.com/adieu/angular-reconnecting-websocket#0.1.1",
|
||||
"angular-resource": "^1.7.7",
|
||||
|
@ -44,7 +44,7 @@
|
|||
"co": "~4.6.0",
|
||||
"co-redis": "^2.1.0",
|
||||
"co-views": "~2.1.0",
|
||||
"copy-webpack-plugin": "^4.6.0",
|
||||
"copy-webpack-plugin": "^5.0.3",
|
||||
"debug": "~4.1.1",
|
||||
"dropzone": "~5.5.1",
|
||||
"ejs": "^2.6.1",
|
||||
|
@ -63,7 +63,7 @@
|
|||
"koa-generic-session": "^2.0.1",
|
||||
"koa-helmet": "^4.0.0",
|
||||
"koa-logger": "~3.2.0",
|
||||
"koa-redis": "^3.1.3",
|
||||
"koa-redis": "^4.0.0",
|
||||
"koa-router": "^7.4.0",
|
||||
"koa-session": "^5.10.1",
|
||||
"koa-static": "^5.0.0",
|
||||
|
@ -79,10 +79,10 @@
|
|||
"passwords": "^1.3.1",
|
||||
"pg": "^7.9.0",
|
||||
"redis": "^2.8.0",
|
||||
"sequelize": "^4.42.0",
|
||||
"sequelize": "^5.8.7",
|
||||
"smooth-scroll": "https://github.com/cferdinandi/smooth-scroll#5.3.7",
|
||||
"statsy": "~0.2.0",
|
||||
"stripe": "^6.23.1",
|
||||
"stripe": "^7.1.0",
|
||||
"webpack": "^4.29.3",
|
||||
"webpack-cli": "^3.2.3",
|
||||
"zeroclipboard": "^2.2.0"
|
||||
|
|
|
@ -183,24 +183,24 @@ Visit ${process.env.WEB_BASE_URL}/forgot/${reset.id} to set a new one.
|
|||
|
||||
export async function fromToken(token) {
|
||||
const userId = await this.redis.get(token);
|
||||
return models.user.findById(userId);
|
||||
return models.user.findByPk(userId);
|
||||
}
|
||||
|
||||
|
||||
export async function fromCookie(rememberId) {
|
||||
const userId = await models.remember.findById(rememberId);
|
||||
return models.user.findById(userId);
|
||||
const userId = await models.remember.findByPk(rememberId);
|
||||
return models.user.findByPk(userId);
|
||||
}
|
||||
|
||||
|
||||
export async function validateResetToken(resetId) {
|
||||
return models.reset.findById(resetId);
|
||||
return models.reset.findByPk(resetId);
|
||||
}
|
||||
|
||||
|
||||
export async function updatePassword(userId, password) {
|
||||
const cryptedPassword = await passwords.crypt(password);
|
||||
const user = await models.user.findById(userId);
|
||||
const user = await models.user.findByPk(userId);
|
||||
user.password = cryptedPassword;
|
||||
await user.save();
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ export async function forgot(ctx) {
|
|||
const user = await validateResetToken(token);
|
||||
if (user) {
|
||||
await updatePassword(user.userId, ctx.request.body.password);
|
||||
const reset = await models.reset.findById(token);
|
||||
const reset = await models.reset.findByPk(token);
|
||||
reset.destroy();
|
||||
await setupSession.call(ctx, user);
|
||||
ctx.statsd.incr('auth.reset.success', 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue