Implement registration, login and require_login