From aca8897bf0f814b473b3bd2deaa31d91ab408791 Mon Sep 17 00:00:00 2001 From: pociej Date: Mon, 8 Apr 2024 12:02:58 +0200 Subject: [PATCH] chore: add debug log to register #38 --- backend/src/services/user/service.ts | 6 ++++++ frontend/src/hooks/useSignNonce.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/src/services/user/service.ts b/backend/src/services/user/service.ts index e69d737..eb2e6a0 100644 --- a/backend/src/services/user/service.ts +++ b/backend/src/services/user/service.ts @@ -1,6 +1,7 @@ import { IUserService, IUser } from "./types.js"; import { userModel } from "./model.js"; import { v4 as uuidv4 } from "uuid"; +import mongoose from "mongoose"; const randomNonce = () => { return Math.floor(Math.random() * 10000000); @@ -9,6 +10,11 @@ const randomNonce = () => { export const userService: IUserService = { registerUser: async (walletAddress: string) => { const user = await userModel.findOne({ walletAddress }); + console.log("#########################"); + console.log("registering user"); + console.log("model", mongoose.connection); + console.log("user", user); + console.log("#########################"); if (user !== null) { return user; } diff --git a/frontend/src/hooks/useSignNonce.ts b/frontend/src/hooks/useSignNonce.ts index dad0e3d..4757e92 100644 --- a/frontend/src/hooks/useSignNonce.ts +++ b/frontend/src/hooks/useSignNonce.ts @@ -45,7 +45,7 @@ export function useSignNonce(): { >({ mutationFn: signNonce, onSuccess: (data) => { - const message = `Kto pracuje w golemie ten się w cyrku nie śmieje nonce: ${data.nonce}`; + const message = `Login to service by signing nonce: ${data.nonce}`; setMessage(message); signMessage({ message,