Fix broken shit after dep updates

This commit is contained in:
Jonathan Cremin 2020-06-14 22:29:04 +01:00
parent 7878346910
commit d89c8872d2
15 changed files with 1169 additions and 713 deletions

View file

@ -12,7 +12,7 @@ export default async (ctx, next) => {
let user = false;
const remoteIp = ctx.req.headers['x-forwarded-for'] || ctx.req.connection.remoteAddress;
const login = await models.login.create({
ip: remoteIp,
ip: remoteIp.split(',')[0],
successful: false,
});
if (ctx.req.headers.authorization && ctx.req.headers.authorization[0] === ':') {
@ -30,7 +30,7 @@ export default async (ctx, next) => {
ctx.assert(authUser, 401, badLoginMsg);
const count = await models.login.count({
where: {
ip: remoteIp,
ip: remoteIp.split(',')[0],
successful: false,
createdAt: {
$gt: new Date(Date.now() - 600000),