Cleaned up logic of login page csrf protection
added csrf protection to register page