hunk.code_window:           "sectionName": null,
             "children": [
               {
                 "label": "Host Address",
                 "configProperty": "datasourceConfiguration.endpoints[*].host",
                 "controlType": "KEYVALUE_ARRAY"
               },
               {
                 "label": "Port",
                 "configProperty": "datasourceConfiguration.endpoints[*].port",
                 "dataType": "NUMBER",
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep keep
hunk.after_edit:               "controlType": "KEYVALUE_ARRAY",
                 "validationMessage": "Please enter a valid host",
                 "validationRegex": "^((?![/:]).)*$"
  
hunk.file_path: app/server/appsmith-plugins/postgresPlugin/src/main/resources/form.json
hunk.type: replace
file: import localforage from "localforage";
  import moment from "moment";
  
  const STORAGE_KEYS: { [id: string]: string } = {
    AUTH_EXPIRATION: "Auth.expiration",
    ROUTE_BEFORE_LOGIN: "RedirectPath",
  };
  
  const store = localforage.createInstance({
    name: "Appsmith",
  });
  
  export const resetAuthExpiration = () => {
    const expireBy = moment()
      .add(1, "h")
      .format();
    store.setItem(STORAGE_KEYS.AUTH_EXPIRATION, expireBy).catch(error => {
      console.log("Unable to set expiration time");
    });
  };
  
  export const hasAuthExpired = async () => {
    const expireBy: string = await store.getItem(STORAGE_KEYS.AUTH_EXPIRATION);
    if (expireBy && moment().isAfter(moment(expireBy))) {
      return true;
    }
    return false;
  };
  