mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-15 14:22:14 +11:00
bugs squashed
This commit is contained in:
parent
d047a217b3
commit
608c9b5474
3 changed files with 31 additions and 18 deletions
|
|
@ -65,13 +65,15 @@ module.exports = function (fastify, opts, done) {
|
|||
"pass": init_pass,
|
||||
}),
|
||||
});
|
||||
post = post.ok;
|
||||
|
||||
} catch (e) {
|
||||
req.session.errors = `${e.text()}`;
|
||||
console.log(e.text());
|
||||
}
|
||||
if (post) {
|
||||
if (post.ok) {
|
||||
req.session.successes = `User ${name} registered.`;
|
||||
} else{
|
||||
req.session.errors = `${await post.text()}`
|
||||
}
|
||||
res.redirect("/admin");
|
||||
}
|
||||
|
|
@ -134,16 +136,17 @@ module.exports = function (fastify, opts, done) {
|
|||
"amount": parseInt(amount),
|
||||
}),
|
||||
});
|
||||
console.log(patch, patch.blob())
|
||||
patch = patch.ok;
|
||||
} catch (e) {
|
||||
req.session.errors = e;
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
console.log(patch);
|
||||
if (patch) {
|
||||
if (patch.ok) {
|
||||
req.session.successes = "Change Funds Successful";
|
||||
} else {
|
||||
req.session.errors = `${await patch.text()}`;
|
||||
|
||||
}
|
||||
res.redirect("/admin");
|
||||
}
|
||||
|
|
@ -178,9 +181,13 @@ module.exports = function (fastify, opts, done) {
|
|||
req.session.errors = `${e}`;
|
||||
console.log(e);
|
||||
}
|
||||
if (patch) {
|
||||
if (patch.ok) {
|
||||
req.session.errors = ""
|
||||
req.session.successes = "Change Funds Successful";
|
||||
} else {
|
||||
req.session.errors = `${await patch.text()}`
|
||||
req.session.successes = "";
|
||||
|
||||
}
|
||||
res.redirect("/admin");
|
||||
}
|
||||
|
|
@ -281,8 +288,6 @@ module.exports = function (fastify, opts, done) {
|
|||
"MARKETPLACE=" +
|
||||
process.env.MARKETPLACE +
|
||||
"\n" +
|
||||
"MONGO=" +
|
||||
process.env.MONGO +
|
||||
"\nSETUP=true"
|
||||
);
|
||||
fs.mkdirSync(`${root}/tmp`);
|
||||
|
|
@ -316,8 +321,10 @@ module.exports = function (fastify, opts, done) {
|
|||
req.session.errors = `${e}`;
|
||||
console.log(e);
|
||||
}
|
||||
if (close) {
|
||||
if (close.ok) {
|
||||
req.session.successes = "Closed instance";
|
||||
} else{
|
||||
req.session.errors = `${await close.text()}`
|
||||
}
|
||||
res.redirect("../");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,13 +86,15 @@ module.exports = function (fastify, opts, done) {
|
|||
console.log(e);
|
||||
}
|
||||
|
||||
if (patch == -2) {
|
||||
req.session.errors = "Password Wrong";
|
||||
return res.redirect("/settings");
|
||||
} else {
|
||||
req.session.destroy();
|
||||
//req.session.successes = "Change Password Successful, Please Login Again";
|
||||
if (patch.ok) {
|
||||
req.session.user = null
|
||||
req.session.password = null;
|
||||
req.session.successes = "Change Password Successful, Please Login Again";
|
||||
return res.redirect("/login");
|
||||
|
||||
} else {
|
||||
req.session.errors = `${await patch.text()}`;
|
||||
return res.redirect("/settings");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -135,8 +137,12 @@ module.exports = function (fastify, opts, done) {
|
|||
}
|
||||
|
||||
console.log(del);
|
||||
if (del) {
|
||||
req.session.destroy();
|
||||
if (del.ok) {
|
||||
req.session.user = null
|
||||
req.session.password = null;
|
||||
req.session.successes = "User Deletion Successful, This is IRREVERSIBLE please do not complain";
|
||||
} else{
|
||||
req.session.errors = `${await del.text()}`
|
||||
}
|
||||
res.redirect("/");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ block content
|
|||
br
|
||||
.card.shadow
|
||||
h4 DELETE ACCOUNT
|
||||
p Dont do this unless you want your account deleted, hate that i have to put warnings on this but there is no undo
|
||||
p This action is IRREVERSIBLE, do not complain if you deleted your account
|
||||
form(method='POST', action='/settings/delete')
|
||||
#form-group
|
||||
label Current Password:
|
||||
|
|
|
|||
Loading…
Reference in a new issue