Skip to content

Commit

Permalink
chore: add debug log to register
Browse files Browse the repository at this point in the history
  • Loading branch information
pociej committed Apr 8, 2024
1 parent e6a2154 commit aca8897
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions backend/src/services/user/service.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useSignNonce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aca8897

Please sign in to comment.