added postSubmit route and requireLogin function