Skip to content
Snippets Groups Projects
Commit c967159a authored by Zayd Radha's avatar Zayd Radha
Browse files

Fixed password

parent 5f88402e
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ var config = require('./public/js/config.js');
var url = require("opn");
var fs = require("fs");
var readline = require("readline");
config.passcode = ''
//---------GLOBAL STATE VARIABLES ----//
var screenWidth = 1440;
......@@ -134,7 +135,8 @@ io.on('connection', function(socket) {
//Keyboard Functionality
socket.on('string', function(pos) {
if (pos.pw) {
console.log(config.passcode)
if (pos.pw || config.passcode) {
if (config.passcode !== pos.pw) { //Password Checker
return;
}
......@@ -151,6 +153,11 @@ io.on('connection', function(socket) {
});
socket.on('functionality', function(type) {
if (pos.pw || config.passcode) {
if (config.passcode !== pos.pw) { //Password Checker
return;
}
}
console.log(type);
switch (type) {
case 'backspace':
......@@ -178,7 +185,7 @@ io.on('connection', function(socket) {
});
socket.on('text', function(pos) {
if (pos.pw) {
if (pos.pw || config.passcode) {
if (config.passcode !== pos.pw) { //Password Checker
return;
}
......@@ -189,7 +196,7 @@ io.on('connection', function(socket) {
});
socket.on('saveKey', function(key) {
if (key.pw) {
if (key.pw || config.passcode) {
if (config.passcode !== key.pw) { //Password Checker
return;
}
......@@ -224,7 +231,7 @@ io.on('connection', function(socket) {
});
socket.on('url', function(pos) {
if (pos.pw) {
if (pos.pw || config.passcode) {
if (config.passcode !== pos.pw) { //Password Checker
return;
}
......@@ -238,7 +245,7 @@ io.on('connection', function(socket) {
//Mouse Functionality
socket.on('mouse', function(pos) {
if (pos.pw) {
if (pos.pw || config.passcode) {
if (config.passcode !== pos.pw) { //Password Checker
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment