code: public static Profile getCurrentProfile() {
          RequestContext context = RequestContext.getCurrent();
          if (context != null) {
              return getProfile(context.getRequest());
          } else {
              return null;
          }
      }
docs: Returns the profile from authentication attribute from the current request.
  
  @return the profile object, or null if there's no authentication