diff --git a/backend/src/services/user/model.ts b/backend/src/services/user/model.ts index 326b3c2..00d6a5a 100644 --- a/backend/src/services/user/model.ts +++ b/backend/src/services/user/model.ts @@ -32,11 +32,6 @@ const schema = new mongoose.Schema( type: Boolean, required: true, }, - id: { - type: String, - required: true, - index: { unique: true }, - }, }, ], }, diff --git a/backend/src/services/user/service.ts b/backend/src/services/user/service.ts index eb2e6a0..f63ca45 100644 --- a/backend/src/services/user/service.ts +++ b/backend/src/services/user/service.ts @@ -10,15 +10,12 @@ 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; } - return new userModel( + console.log("no user"); + const newu = await new userModel( { walletAddress, nonce: randomNonce(), @@ -29,6 +26,8 @@ export const userService: IUserService = { _id: true, } ).save(); + console.log("new user", newu); + return newu; }, regenerateNonce: async (userId: string) => { const nonce = randomNonce(); diff --git a/frontend/src/components/allowanceSummary.tsx b/frontend/src/components/allowanceSummary.tsx index e115943..8faef6c 100644 --- a/frontend/src/components/allowanceSummary.tsx +++ b/frontend/src/components/allowanceSummary.tsx @@ -19,7 +19,7 @@ export const AllowanceSummary = ({ isVisible }: { isVisible: boolean }) => { borderRadius: "16px", padding: "1rem", fontSize: "1.3rem", - minWidth: "380px", + minWidth: "350px", }} >

diff --git a/frontend/src/components/registerSummary.tsx b/frontend/src/components/registerSummary.tsx index 440f413..685bace 100644 --- a/frontend/src/components/registerSummary.tsx +++ b/frontend/src/components/registerSummary.tsx @@ -15,7 +15,7 @@ export const RegisterSummary = ({ isVisible }: { isVisible: boolean }) => { borderRadius: "16px", padding: "1rem", fontSize: "1.3rem", - minWidth: "380px", + minWidth: "350px", }} initial={{ opacity: 0 }} animate={{ opacity: 1 }}