Refactored authorization from HomeController to UserCookieInterceptor
[examples/facebook-app] / src / main / java / de / juplo / yourshouter / HomeController.java
index c5ece60..c74316e 100644 (file)
@@ -37,22 +37,6 @@ public class HomeController
   @RequestMapping(method = RequestMethod.GET)
   public String home(Model model)
   {
-    boolean authorized = true;
-    try
-    {
-      authorized = facebook.isAuthorized();
-    }
-    catch (NullPointerException e)
-    {
-      LOG.debug("NPE while acessing Facebook: {}", e);
-      authorized = false;
-    }
-    if (!authorized)
-    {
-      LOG.info("no authorized user, redirecting to /signin.html");
-      return "redirect:/signin.html";
-    }
-
     User user = facebook.userOperations().getUserProfile();
     LOG.info("authorized user {}, id: {}", user.getName(), user.getId());
     model.addAttribute("user", user);