{"version":3,"file":"forgot-password.mjs","sources":["../../../../../server/graphql/mutations/auth/forgot-password.js"],"sourcesContent":["'use strict';\n\nconst { toPlainObject } = require('lodash/fp');\n\nconst { checkBadRequest } = require('../../utils');\n\nmodule.exports = ({ nexus, strapi }) => {\n  const { nonNull } = nexus;\n\n  return {\n    type: 'UsersPermissionsPasswordPayload',\n\n    args: {\n      email: nonNull('String'),\n    },\n\n    description: 'Request a reset password token',\n\n    async resolve(parent, args, context) {\n      const { koaContext } = context;\n\n      koaContext.request.body = toPlainObject(args);\n\n      await strapi.plugin('users-permissions').controller('auth').forgotPassword(koaContext);\n\n      const output = koaContext.body;\n\n      checkBadRequest(output);\n\n      return {\n        ok: output.ok || output,\n      };\n    },\n  };\n};\n"],"names":["toPlainObject","require$$0","checkBadRequest","require$$1","forgotPassword","nexus","strapi","nonNull","type","args","email","description","resolve","parent","context","koaContext","request","body","plugin","controller","output","ok"],"mappings":";;;;;;;;IAEA,MAAM,EAAEA,aAAa,EAAE,GAAGC,UAAAA;IAE1B,MAAM,EAAEC,eAAe,EAAE,GAAGC,YAAAA,EAAAA;AAE5BC,IAAAA,cAAAA,GAAiB,CAAC,EAAEC,KAAK,EAAEC,MAAM,EAAE,GAAA;QACjC,MAAM,EAAEC,OAAO,EAAE,GAAGF,KAAAA;QAEpB,OAAO;YACLG,IAAAA,EAAM,iCAAA;YAENC,IAAAA,EAAM;AACJC,gBAAAA,KAAAA,EAAOH,OAAAA,CAAQ,QAAA;AACrB,aAAA;YAEII,WAAAA,EAAa,gCAAA;AAEb,YAAA,MAAMC,OAAAA,CAAAA,CAAQC,MAAM,EAAEJ,IAAI,EAAEK,OAAO,EAAA;gBACjC,MAAM,EAAEC,UAAU,EAAE,GAAGD,OAAAA;AAEvBC,gBAAAA,UAAAA,CAAWC,OAAO,CAACC,IAAI,GAAGjB,aAAAA,CAAcS,IAAAA,CAAAA;gBAExC,MAAMH,MAAAA,CAAOY,MAAM,CAAC,mBAAA,CAAA,CAAqBC,UAAU,CAAC,MAAA,CAAA,CAAQf,cAAc,CAACW,UAAAA,CAAAA;gBAE3E,MAAMK,MAAAA,GAASL,WAAWE,IAAI;gBAE9Bf,eAAAA,CAAgBkB,MAAAA,CAAAA;gBAEhB,OAAO;oBACLC,EAAAA,EAAID,MAAAA,CAAOC,EAAE,IAAID;AACzB,iBAAA;AACA,YAAA;AACA,SAAA;AACA,IAAA,CAAA;;;;;;"}