adding redirect to login to front end code