You can use `requires_login` decorator.