File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ function startKafkaConsumer(handlers) {
103
103
topicId,
104
104
userEmail : helper . sanitizeEmail ( user . email ) ,
105
105
} ;
106
+ logger . debug ( 'body' , body ) ;
106
107
logger . debug ( `body for generating token: ${ JSON . stringify ( body ) } ` ) ;
107
108
logger . debug ( `authSecret: ${ config . authSecret . substring ( - 5 ) } ` ) ;
108
109
const token = jwt . sign ( body , config . authSecret , { noTimestamp : true } ) . split ( '.' ) [ 2 ] ;
Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ function autoWrapExpress(obj) {
49
49
*/
50
50
function sanitizeEmail ( email ) {
51
51
if ( email ) {
52
- return email . substring ( 0 , email . indexOf ( '+' ) ) + email . substring ( email . indexOf ( '@' ) ) ;
52
+ return email . substring ( 0 , email . indexOf ( '+' ) !== - 1 ? email . indexOf ( '+' ) : email . indexOf ( '@' ) )
53
+ + email . substring ( email . indexOf ( '@' ) ) ;
53
54
}
54
55
return '' ;
55
56
}
You can’t perform that action at this time.
0 commit comments