Skip to content

Commit 7d744c2

Browse files
committed
ci: logs
1 parent d501142 commit 7d744c2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/server/auth.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,24 @@ export const authOptions: (ctxReq: CtxOrReq) => NextAuthOptions = ({
176176
domain: nextAuthUrl.host,
177177
nonce,
178178
});
179+
console.log({ verified });
179180

180181
if (!verified.success) {
181182
throw new Error("Verification failed");
182183
}
183184

184185
const { data: fields } = verified;
185186

187+
console.log({ fields });
188+
186189
// Check if user exists
187190
let user = await prisma.user.findUnique({
188191
where: {
189192
address: fields.address,
190193
},
191194
});
195+
196+
console.log("1 ", { user });
192197
// Create new user if doesn't exist
193198
if (!user) {
194199
user = await prisma.user.create({
@@ -197,15 +202,18 @@ export const authOptions: (ctxReq: CtxOrReq) => NextAuthOptions = ({
197202
image: "https://www.developerdao.com/D_D_logo-dark.svg",
198203
},
199204
});
205+
206+
console.log("2 ", { user });
200207
// create account
201-
await prisma.account.create({
208+
const newAccount = await prisma.account.create({
202209
data: {
203210
userId: user.id,
204211
type: "credentials",
205212
provider: "Ethereum",
206213
providerAccountId: fields.address,
207214
},
208215
});
216+
console.log({ newAccount });
209217
}
210218

211219
return {

0 commit comments

Comments
 (0)