Integrated login/logout + fixed requires_login