strapi

Strapi Change Password

 module.exports = { index: async ctx => { // Get posted params // const params = JSON.parse(ctx.request.body); //if post raw object using Postman const params = ctx.request.body; // The identifier is required. if (!params.identifier) { return ctx.badRequest( null, formatError({ id: ‘Auth.form.error.email.provide’, message: ‘Please provide your username or your e-mail.’, }) ); } // Other params …

Strapi Change Password Read More »

Starpi forgot password custom routes

 // ‘use strict’; /** * This is controller for `essential` */ module.exports = { async sendEmail(ctx) { try { let userResponse = await strapi.db.query(‘plugin::users-permissions.user’).findOne({ where: { email: ctx.request.body.email }, }); if (userResponse) { let resetToken = function (length) { var a = “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890”.split(“”); var b = []; for (var i = 0; i < length; …

Starpi forgot password custom routes Read More »