Commit 48ccf126 by kashif ansari

internal server error issue fix while entering wrong OTP

1 parent 17329f21
......@@ -5,8 +5,11 @@
*/
const { factories } = require("@strapi/strapi");
const { getService } = require("@strapi/plugin-users-permissions/server/utils");
const { getService } = require("@strapi/plugin-users-permissions/server/utils");
const utils = require("@strapi/utils");
const { sanitize } = utils;
const { ValidationError } = utils.errors;
module.exports = factories.createCoreController(
"api::end-user.end-user",
({ strapi: Strapi }) => ({
......@@ -191,9 +194,12 @@ module.exports = factories.createCoreController(
ctx.request.body.data.httpRequestEmailHeaders = JSON.stringify(
spretoOTP.spertoEmailResponse.headers
);
ctx.request.body.data.httpRequestEmailMethod = spretoOTP.spertoEmailResponse.config.method;
ctx.request.body.data.httpRequestEmailUrl = spretoOTP.spertoEmailResponse.config.url;
ctx.request.body.data.httpsRequestEmailBody = spretoOTP.spertoEmailResponse.config.data;
ctx.request.body.data.httpRequestEmailMethod =
spretoOTP.spertoEmailResponse.config.method;
ctx.request.body.data.httpRequestEmailUrl =
spretoOTP.spertoEmailResponse.config.url;
ctx.request.body.data.httpsRequestEmailBody =
spretoOTP.spertoEmailResponse.config.data;
ctx.request.body.data.httpResposneEmailBody = JSON.stringify(
spretoOTP.spertoEmailResponse.data
);
......@@ -201,16 +207,16 @@ module.exports = factories.createCoreController(
ctx.request.body.data.httpSMSRequestHeaders = JSON.stringify(
spretoOTP.spertoEmailResponse.headers
);
ctx.request.body.data.httpSMSRequestMethod = spretoOTP.spertoEmailResponse.config.method;
ctx.request.body.data.httpSMSRequestUrl = spretoOTP.spertoEmailResponse.config.url;
ctx.request.body.data.httpsSMSRequestBody
= spretoOTP.spertoEmailResponse.config.data;
ctx.request.body.data.httpSMSRequestMethod =
spretoOTP.spertoEmailResponse.config.method;
ctx.request.body.data.httpSMSRequestUrl =
spretoOTP.spertoEmailResponse.config.url;
ctx.request.body.data.httpsSMSRequestBody =
spretoOTP.spertoEmailResponse.config.data;
ctx.request.body.data.httpSMSResposneBody = JSON.stringify(
spretoOTP.spertoEmailResponse.data
);
ctx.request.body.data.thirdPartyApiError = false;
} catch (error) {
ctx.request.body.data.httpRequestEmailHeaders = JSON.stringify(
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!