Adds login validation before visitting routes and adds button to close edit field form