code: public static Profile getProfile(HttpServletRequest request) {
          Authentication auth = getAuthentication(request);
          if (auth != null) {
              return auth.getProfile();
          } else {
              return null;
          }
      }
docs: Returns the profile from authentication attribute from the specified request.
  
  @return the profile object, or null if there's no authentication