Skip to content

Commit

Permalink
add additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNi245 committed Jul 29, 2024
1 parent 9adf974 commit abdde76
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/backend/src/persistence/session/getAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export function getAccount(redis: Redis) {
RedisPrefix.Account + (await getIdEnsName(redis)(ensName)),
);

console.debug('get account ', ensName, session);

return session
? (JSON.parse(session) as Session & {
spamFilterRules: spamFilter.SpamFilterRules;
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/persistence/session/setAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function setAccount(redis: Redis) {
if (!isValid) {
throw Error('Invalid session');
}
console.debug('set account ', ensName, session);
await redis.set(
RedisPrefix.Account + (await getIdEnsName(redis)(ensName)),
stringify(session),
Expand Down
5 changes: 2 additions & 3 deletions packages/delivery-service/src/messaging.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Session } from '@dm3-org/dm3-lib-delivery';
import { EncryptionEnvelop } from '@dm3-org/dm3-lib-messaging';
import { UserProfile } from '@dm3-org/dm3-lib-profile';
import { IWebSocketManager, ethersHelper } from '@dm3-org/dm3-lib-shared';
import {
Expand All @@ -8,11 +9,9 @@ import {
getMockDeliveryServiceProfile,
mockUserProfile,
} from '@dm3-org/dm3-lib-test-helper';
import { ethers } from 'ethers';
import { Socket } from 'socket.io';
import { testData } from '../../../test-data/encrypted-envelops.test';
import { onConnection } from './messaging';
import { ethers } from 'ethers';
import { EncryptionEnvelop } from '@dm3-org/dm3-lib-messaging';

const serverSecret = 'secret';
const mockWsManager: IWebSocketManager = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export function setAccount(redis: Redis) {
throw Error('Invalid address');
}

console.debug('set account ', address, session);

await redis.set(
RedisPrefix.Account + ethers.utils.getAddress(address),
stringify(session),
Expand Down
1 change: 1 addition & 0 deletions packages/lib/server-side/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const createNewSessionTokenBodySchema = {

export const Auth = (db: IAccountDatabase, serverSecret: string) => {
const router = express.Router();
console.debug('Auth DB ', db);

//TODO remove
router.use(cors());
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/server-side/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function logError(
res: Response,
next: NextFunction,
) {
winston.loggers.get('default').error({
console.error({
method: req.method,
url: req.url,
error: error.toString(),
Expand Down

0 comments on commit abdde76

Please sign in to comment.