|
|
@@ -113,6 +113,22 @@ sequelize
|
|
|
if (!settings.find((setting) => setting.name === "match_country")) {
|
|
|
Settings.create({ name: "match_country", value: "US,CA" });
|
|
|
}
|
|
|
+ if (!settings.find((setting) => setting.name === "proxy_host")) {
|
|
|
+ Settings.create({
|
|
|
+ name: "proxy_host",
|
|
|
+ value: "199.188.93.128:8000",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ !settings.find((setting) => setting.name === "proxy_username")
|
|
|
+ ) {
|
|
|
+ Settings.create({ name: "proxy_username", value: "proxy" });
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ !settings.find((setting) => setting.name === "proxy_password")
|
|
|
+ ) {
|
|
|
+ Settings.create({ name: "proxy_password", value: "40gyxQ2" });
|
|
|
+ }
|
|
|
});
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
@@ -201,8 +217,30 @@ fastify.post("/login", async function (request, reply) {
|
|
|
.send({ error: "email and password are required" });
|
|
|
} else {
|
|
|
const { email, password } = request.body;
|
|
|
+ const proxy_host = (
|
|
|
+ await Settings.findOne({ where: { name: "proxy_host" } })
|
|
|
+ )?.value;
|
|
|
+ const proxy_username = (
|
|
|
+ await Settings.findOne({ where: { name: "proxy_username" } })
|
|
|
+ )?.value;
|
|
|
+ const proxy_password = (
|
|
|
+ await Settings.findOne({ where: { name: "proxy_password" } })
|
|
|
+ )?.value;
|
|
|
+ let proxy = null;
|
|
|
+ if (proxy_host && proxy_username && proxy_password) {
|
|
|
+ proxy = {
|
|
|
+ server: proxy_host,
|
|
|
+ username: proxy_username,
|
|
|
+ password: proxy_password,
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
- const { points, cookies, options } = await login(email, password);
|
|
|
+ const { points, cookies, options } = await login(
|
|
|
+ email,
|
|
|
+ password,
|
|
|
+ proxy
|
|
|
+ );
|
|
|
let balance = null;
|
|
|
let dollarsRedeemable = null;
|
|
|
if (points) {
|