Kanha Help Me

pusher in node js

1. install pusher npm i pusher 2. inport pusher const Pusher = require(“pusher”); 3. Initialize The pusher app details let pusher = new Pusher({ appId: “1357043”, key: “718b7cb5ef13acf494ed”, secret: “b8db8f3102c255fd9136”, cluster: “ap2”, }); 4. Trigger the channel pusher.trigger(“my-channel”, “my-event”, { message: “Hello world from pusher” });  

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 »

user.js

 ‘use strict’; /** * Auth.js controller * * @description: A set of functions called “actions” for managing `Auth`. */ /* eslint-disable no-useless-escape */ const crypto = require(‘crypto’); const _ = require(‘lodash’); const utils = require(‘@strapi/utils’); const { getService } = require(‘../utils’); const { validateCallbackBody, validateRegisterBody, validateSendEmailConfirmationBody, } = require(‘./validation/auth’); const { sanitize } = utils; …

user.js Read More »