hunk.code_window:             } else if (objResult instanceof DocumentSnapshot) {
                   // Individual document.
                   DocumentSnapshot documentSnapshot = (DocumentSnapshot) objResult;
                   Map<String, Object> resultMap = new HashMap<>();
                   resultMap.put("$ref", resultToMap(documentSnapshot.getReference()));
                   if (documentSnapshot.getData() != null) {
                       for (final Map.Entry<String, Object> entry : documentSnapshot.getData().entrySet()) {
                           resultMap.put(entry.getKey(), resultToMap(entry.getValue(), false));
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:                 resultMap.put("_ref", resultToMap(documentSnapshot.getReference()));
  
hunk.file_path: app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/plugins/FirestorePlugin.java
hunk.type: replace
file: import React from "react";
  import { useSelector } from "react-redux";
  import { Redirect } from "react-router-dom";
  
  import { getCurrentUser } from "selectors/usersSelectors";
  import { ANONYMOUS_USERNAME } from "constants/userConstants";
  import { APPLICATIONS_URL } from "constants/routes";
  
  const requiresAuthHOC = (Component: React.ComponentType) => {
    const Wrapped = (props: any) => {
      const user = useSelector(getCurrentUser);
  
      if (user?.email && user?.email !== ANONYMOUS_USERNAME) {
        return <Redirect to={APPLICATIONS_URL} />;
      }
      return <Component {...props} />;
    };
  
    return Wrapped;
  };
  
  export default requiresAuthHOC;
  