User permissions added

This commit is contained in:
rawee 2022-12-25 17:37:12 +05:30
parent 65484961e2
commit bed8cf1ea2
3 changed files with 10 additions and 4 deletions

View File

@ -9,7 +9,7 @@ Missing Nodes ? : To avoid long names, Node names are updated. If some node are
![](./.github/admin_login.gif) ![](./.github/admin_login.gif)
1. Deploy whatsapp admin node (along with whatsappLink node). 1. Deploy whatsapp admin node (along with whatsappLink node).
2. whatsappLink node will initilize, connect with whatsapp and generate a <b>QR code below the Admin Node </b> and in terminal also. 2. whatsappLink node will initilize, connect with whatsapp and generate a <b>QR code below the Admin Node </b> (in terminal also).
3. Scan the QR code with your Whatsapp Mobile App (Go to settings > Linked device > Scan & Connect). 3. Scan the QR code with your Whatsapp Mobile App (Go to settings > Linked device > Scan & Connect).
4. Done - Whatsapp Connected. 4. Done - Whatsapp Connected.

View File

@ -27,7 +27,7 @@
<input type="text" id="node-input-whatsappLink" placeholder="Name"> <input type="text" id="node-input-whatsappLink" placeholder="Name">
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="node-input-gID"><i class="fa fa-address-card-o"></i> Number</label> <label for="node-input-gID"><i class="fa fa-address-card-o"></i> Group ID </label>
<input type="text" id="node-input-gID" placeholder="Group Chat ID.."> <input type="text" id="node-input-gID" placeholder="Group Chat ID..">
</div> </div>
<div class="form-tips"> <div class="form-tips">

View File

@ -1,14 +1,20 @@
module.exports = function(RED) { module.exports = function(RED) {
const { Client, LocalAuth } = require('whatsapp-web.js'); const { Client, LocalAuth } = require('whatsapp-web.js');
const QRCode = require('qrcode'); const QRCode = require('qrcode');
const OS = require('os');
const Path = require('path');
function RemoteClientNode(n) { let userDir = OS.homedir();
let whatsappLinkDir = Path.join(userDir, '.node-red', 'Whatsapp-Link');
function RemoteClientNode(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
let WAnode = this; let WAnode = this;
let whatsappConnectionStatus; let whatsappConnectionStatus;
const client = new Client({ const client = new Client({
authStrategy : new LocalAuth(), authStrategy : new LocalAuth({
dataPath : whatsappLinkDir
}),
puppeteer : {headless : true } puppeteer : {headless : true }
}); });