File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change 52
52
code : 406 ,
53
53
message : 'User quota exceeded' ,
54
54
} ,
55
- COULD_NOT_CREATE : {
56
- code : 500 ,
57
- message : 'Could not create profile ' ,
55
+ ERROR_SENDING_EMAIL : {
56
+ code : 501 ,
57
+ message : 'Could not send verification email ' ,
58
58
} ,
59
59
} ;
60
60
359
359
emailPlugin . sendVerificationEmail ( email , secret , function ( err , res ) {
360
360
if ( err ) {
361
361
logger . error ( 'error sending verification email' , email , secret , err ) ;
362
- return callback ( emailPlugin . errors . INTERNAL_ERROR ) ;
362
+ return callback ( emailPlugin . errors . ERROR_SENDING_EMAIL ) ;
363
363
}
364
+ return callback ( ) ;
364
365
} ) ;
365
366
}
366
- callback ( ) ;
367
367
} ) ;
368
368
} ;
369
369
536
536
*/
537
537
function ( callback ) {
538
538
emailPlugin . saveEncryptedData ( email , key , record , function ( err ) {
539
- if ( err ) {
540
- return callback ( err ) ;
541
- }
542
- return callback ( ) ;
539
+ return callback ( err ) ;
543
540
} ) ;
544
541
} ,
545
542
/**
551
548
emailPlugin . createVerificationSecretAndSendEmail ( email , function ( err ) {
552
549
if ( err ) {
553
550
errorCreating = true ;
554
- return callback ( err ) ;
555
551
}
556
- return callback ( ) ;
552
+ return callback ( err ) ;
557
553
} ) ;
558
554
} ,
559
555
] ,
560
556
function ( err ) {
561
557
if ( err ) {
562
558
if ( isNewProfile && ! isConfirmed && errorCreating ) {
563
- emailPlugin . deleteWholeProfile ( email , function ( err ) {
564
- return emailPlugin . returnError ( emailPlugin . errors . COULD_NOT_CREATE , response ) ;
559
+ emailPlugin . deleteWholeProfile ( email , function ( ) {
560
+ return emailPlugin . returnError ( err , response ) ;
565
561
} ) ;
566
562
}
567
563
You can’t perform that action at this time.
0 commit comments