Unverified Commit 9eb055fb authored by Justin Welch's avatar Justin Welch Committed by GitHub

Merge pull request #127 from steemit/118-recovery-bug-take-2

118 recovery bug take 2
parents cfc25f8d ebed8285
......@@ -48,7 +48,7 @@ export default function useAccountRecoveryApi(app) {
const arec = yield models.AccountRecoveryRequest.findOne({
attributes: ['id', 'account_name', 'owner_key'],
where: { validation_code: esc(code) },
order: 'id desc',
order: [['id', 'DESC']],
});
if (arec) {
this.session.arec = arec.id;
......
......@@ -158,7 +158,7 @@ export default function useGeneralApi(app) {
const same_ip_account = yield models.Account.findOne({
attributes: ['created_at'],
where: { remote_ip: esc(remote_ip), created: true },
order: 'id DESC',
order: [['id', 'DESC']],
});
if (same_ip_account) {
const minutes =
......@@ -236,7 +236,7 @@ export default function useGeneralApi(app) {
const existing_account = yield models.Account.findOne({
attributes: ['id'],
where: { user_id, name: account.name },
order: 'id DESC',
order: [['id', 'DESC']],
});
if (existing_account) {
yield existing_account.update(account_attrs);
......@@ -368,9 +368,7 @@ export default function useGeneralApi(app) {
if (!sigHex) return;
if (weight !== 1 || weight_threshold !== 1) {
console.error(
`/login_account login_challenge unsupported ${
type
} auth configuration: ${account}`
`/login_account login_challenge unsupported ${type} auth configuration: ${account}`
);
} else {
const sig = parseSig(sigHex);
......
......@@ -266,9 +266,7 @@ export default function useEnterAndConfirmEmailPages(app) {
]);
if (check_account_res && check_account_res.length > 0) {
this.flash = {
error: `${
picked_account_name
} is already taken, please try another name`,
error: `${picked_account_name} is already taken, please try another name`,
};
this.redirect('/pick_account' + makeParams(params));
return;
......@@ -455,7 +453,7 @@ export default function useEnterAndConfirmEmailPages(app) {
const existing_account = yield models.Account.findOne({
attributes: ['id'],
where: { user_id: user.id, name: account },
order: 'id DESC',
order: [['id', 'DESC']],
});
if (!existing_account) {
yield models.Account.create({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment