fix: set raw true

This commit is contained in:
karishmas6
2024-10-27 17:56:39 +05:30
parent 1c9c23af8f
commit 36cdb36f89

View File

@@ -3,6 +3,7 @@ import { chromium } from "playwright";
import User from '../models/User';
import { encrypt, decrypt } from '../utils/auth';
import { requireSignIn } from '../middlewares/auth';
import { configureProxy } from 'maxun-core';
export const router = Router();
@@ -160,7 +161,7 @@ const maskProxyUrl = (url: string) => {
// TODO: Move this from here
export const getDecryptedProxyConfig = async (userId: string) => {
const user = await User.findByPk(userId, {
attributes: ['proxy_url', 'proxy_username', 'proxy_password'],
raw: true,
});
if (!user) {
@@ -171,6 +172,8 @@ export const getDecryptedProxyConfig = async (userId: string) => {
const decryptedProxyUsername = user.proxy_username ? decrypt(user.proxy_username) : null;
const decryptedProxyPassword = user.proxy_password ? decrypt(user.proxy_password) : null;
console.log(`Decrypting ${decryptedProxyUrl}, ${decryptedProxyUsername}, ${decryptedProxyPassword}`);
return {
proxy_url: decryptedProxyUrl,
proxy_username: decryptedProxyUsername,