File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -291,13 +291,19 @@ export class UserResolver {
291
291
emailConfirmationSentAt : new Date ( ) ,
292
292
} ) ;
293
293
294
+ const updatedUser = await findUserById ( userId ) ;
295
+
296
+ if ( ! updatedUser ) {
297
+ throw new Error ( i18n . __ ( translationErrorMessagesKeys . USER_NOT_FOUND ) ) ;
298
+ }
299
+
294
300
await getNotificationAdapter ( ) . sendUserEmailConfirmation ( {
295
301
email,
296
- user : userToVerify ,
302
+ user : updatedUser ,
297
303
code,
298
304
} ) ;
299
305
300
- return userToVerify ;
306
+ return updatedUser ;
301
307
} catch ( e ) {
302
308
logger . error ( 'userVerificationSendEmailConfirmation() error' , e ) ;
303
309
throw e ;
@@ -356,7 +362,13 @@ export class UserResolver {
356
362
emailConfirmationSentAt : null ,
357
363
} ) ;
358
364
359
- return userFromDB ;
365
+ const updatedUser = await findUserById ( userId ) ;
366
+
367
+ if ( ! updatedUser ) {
368
+ throw new Error ( i18n . __ ( translationErrorMessagesKeys . USER_NOT_FOUND ) ) ;
369
+ }
370
+
371
+ return updatedUser ;
360
372
} catch ( e ) {
361
373
logger . error ( 'userVerificationConfirmEmail() error' , e ) ;
362
374
throw e ;
You can’t perform that action at this time.
0 commit comments