public HttpResponse All() { if (!IsUserSignIn()) { return(Redirect("/Users/Login")); } var viewModel = tripsService.AllTrips(); return(View(viewModel)); }
public HttpResponse All() { if (!User.IsAuthenticated) { //return Redirect("/Users/Login"); return(Error($"401 Unauthorized")); // This way is more ser-friendly } var viewModel = tripsService.AllTrips(); return(View(viewModel)); }