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