@@ -34,15 +34,16 @@ function AccountRecovery (corsSettings, options = {}) {
3434 const ldp = req . app . locals . ldp
3535 const emailService = req . app . locals . email
3636
37- if ( ! req . body . account ) {
38- res . send ( 406 )
39- return
40- }
37+ // if (!req.body.account) {
38+ // res.status (406).send('You need to pass an account' )
39+ // return
40+ // }
4141
4242 // Check if account exists
4343 ldp . graph ( req . body . account , '/' + ldp . suffixAcl , function ( err , graph ) {
4444 if ( err ) {
45- res . send ( err . status , 'Fail to find user' )
45+ // console.log("answer back:", err)
46+ res . status ( err . status || 500 ) . send ( 'Fail to find user' )
4647 return
4748 }
4849
@@ -58,7 +59,7 @@ function AccountRecovery (corsSettings, options = {}) {
5859 } )
5960
6061 if ( ! emailAddress ) {
61- res . send ( 406 , 'No emailAddress registered in your account' )
62+ res . status ( 406 ) . send ( 'No emailAddress registered in your account' )
6263 return
6364 }
6465
@@ -77,7 +78,7 @@ function AccountRecovery (corsSettings, options = {}) {
7778
7879 router . get ( '/confirm' , function ( res , req , next ) {
7980 if ( ! req . query . token ) {
80- res . send ( 406 , 'Token is required' )
81+ res . status ( 406 ) . send ( 'Token is required' )
8182 return
8283 }
8384
0 commit comments