File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -176,19 +176,24 @@ export const authOptions: (ctxReq: CtxOrReq) => NextAuthOptions = ({
176
176
domain : nextAuthUrl . host ,
177
177
nonce,
178
178
} ) ;
179
+ console . log ( { verified } ) ;
179
180
180
181
if ( ! verified . success ) {
181
182
throw new Error ( "Verification failed" ) ;
182
183
}
183
184
184
185
const { data : fields } = verified ;
185
186
187
+ console . log ( { fields } ) ;
188
+
186
189
// Check if user exists
187
190
let user = await prisma . user . findUnique ( {
188
191
where : {
189
192
address : fields . address ,
190
193
} ,
191
194
} ) ;
195
+
196
+ console . log ( "1 " , { user } ) ;
192
197
// Create new user if doesn't exist
193
198
if ( ! user ) {
194
199
user = await prisma . user . create ( {
@@ -197,15 +202,18 @@ export const authOptions: (ctxReq: CtxOrReq) => NextAuthOptions = ({
197
202
image : "https://www.developerdao.com/D_D_logo-dark.svg" ,
198
203
} ,
199
204
} ) ;
205
+
206
+ console . log ( "2 " , { user } ) ;
200
207
// create account
201
- await prisma . account . create ( {
208
+ const newAccount = await prisma . account . create ( {
202
209
data : {
203
210
userId : user . id ,
204
211
type : "credentials" ,
205
212
provider : "Ethereum" ,
206
213
providerAccountId : fields . address ,
207
214
} ,
208
215
} ) ;
216
+ console . log ( { newAccount } ) ;
209
217
}
210
218
211
219
return {
You can’t perform that action at this time.
0 commit comments