convert js to ts
case '/local/forgot':
if( req.method==='POST' ) {
const email=req.body.email.toLowerCase();
return server.get_user_by_email( email ).then ( p => {
if ( p ) {
server.push_token( p, common.get_uuid() );
return res.redirect(`/auth/local/email_sent?email=${email}`);
}
else
return res.redirect(`/auth/local/forgot`);
});
}