updates
This commit is contained in:
parent
6a4a75b56f
commit
22f46999d3
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@ -8,7 +8,7 @@
|
|||||||
"name": "React",
|
"name": "React",
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"url": "http://localhost:3000",
|
"url": "http://localhost:6969",
|
||||||
"webRoot": "${workspaceRoot}/react-backend/client/src"
|
"webRoot": "${workspaceRoot}/react-backend/client/src"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"skipFiles": [
|
"skipFiles": [
|
||||||
"<node_internals>/**"
|
"<node_internals>/**"
|
||||||
],
|
],
|
||||||
"program": "${workspaceFolder}/lib/encrypt.js"
|
"program": "${workspaceFolder}/lib/addAccounts.js"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,22 +1,69 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import axios from 'axios';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
state = { streams: [] }
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.state = {
|
||||||
|
fname: '',
|
||||||
|
lname: '',
|
||||||
|
streams: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
fetch('/getStreams')
|
fetch('/getStreams')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(streams => this.setState({ streams }));
|
.then(streams => this.setState({ streams }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onChange = (e) => {
|
||||||
|
/*
|
||||||
|
Because we named the inputs to match their
|
||||||
|
corresponding values in state, it's
|
||||||
|
super easy to update the state
|
||||||
|
*/
|
||||||
|
this.setState({ [e.target.name]: e.target.value });
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit = (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
// get our form data out of state
|
||||||
|
const { fname, lname } = this.state;
|
||||||
|
console.log({ fname, lname })
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { fname, lname } = this.state;
|
||||||
return (
|
return (
|
||||||
<section class="container">
|
<section class="container">
|
||||||
<div class="left-half">
|
<div class="left-half">
|
||||||
<article>
|
<article>
|
||||||
<h1>User Login</h1>
|
<h1>User Login</h1>
|
||||||
<p>
|
<p>
|
||||||
I am a user login
|
<form onSubmit={this.onSubmit}>
|
||||||
|
<p>UserName
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="fname"
|
||||||
|
value={fname}
|
||||||
|
onChange={this.onChange}
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
<p>Password
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="lname"
|
||||||
|
value={lname}
|
||||||
|
onChange={this.onChange}
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
<button type="submit">Login</button>
|
||||||
|
</form>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-half">
|
<div class="right-half">
|
||||||
|
60
client/src/app2.js
Normal file
60
client/src/app2.js
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
class UserForm extends Component {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.state = {
|
||||||
|
fname: '',
|
||||||
|
lname: '',
|
||||||
|
email: '',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
onChange = (e) => {
|
||||||
|
/*
|
||||||
|
Because we named the inputs to match their
|
||||||
|
corresponding values in state, it's
|
||||||
|
super easy to update the state
|
||||||
|
*/
|
||||||
|
this.setState({ [e.target.name]: e.target.value });
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit = (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
// get our form data out of state
|
||||||
|
const { fname, lname, email } = this.state;
|
||||||
|
|
||||||
|
axios.post('/', { fname, lname, email })
|
||||||
|
.then((result) => {
|
||||||
|
//access the results here....
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { fname, lname, email } = this.state;
|
||||||
|
return (
|
||||||
|
<form onSubmit={this.onSubmit}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="fname"
|
||||||
|
value={fname}
|
||||||
|
onChange={this.onChange}
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="lname"
|
||||||
|
value={lname}
|
||||||
|
onChange={this.onChange}
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="email"
|
||||||
|
value={email}
|
||||||
|
onChange={this.onChange}
|
||||||
|
/>
|
||||||
|
<button type="submit">Submit</button>
|
||||||
|
</form>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -4,33 +4,41 @@ const cryptr = new Cryptr('BBLBTV-DNS-PASSWORDS');
|
|||||||
const sql = require('./mysql')
|
const sql = require('./mysql')
|
||||||
|
|
||||||
function storeAccountToDB(accountDetails) {
|
function storeAccountToDB(accountDetails) {
|
||||||
const encryptedPassword = cryptr.encrypt(accountDetails.password);
|
const encryptedPassword = cryptr.encrypt(accountDetails.password);
|
||||||
const result = sql.query(`INSERT userAccounts (username, password, stream, userID) VALUES ("${accountDetails.username}", "${encryptedPassword}", "${accountDetails.stream}", ${accountDetails.userId})`);
|
const result = sql.query(`INSERT userAccounts (username, password, stream, userID) VALUES ("${accountDetails.username}", "${encryptedPassword}", "${accountDetails.stream}", ${accountDetails.userId})`);
|
||||||
// console.log(result)
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function retrievePasswordFromDB(user, userAccUser) {
|
function retrievePasswordFromDB(user, userAccUser) {
|
||||||
let userId = sql.query(`SELECT u.idusers FROM users u WHERE u.userName = '${user}'`);
|
let userId
|
||||||
|
try {
|
||||||
|
userId = sql.query(`SELECT u.idusers FROM users u WHERE u.userName = '${user}'`);
|
||||||
userId = userId[0].idusers
|
userId = userId[0].idusers
|
||||||
|
} catch (error) {
|
||||||
|
console.log('User not found')
|
||||||
|
return (error)
|
||||||
|
}
|
||||||
|
|
||||||
let accountPassword = sql.query(`SELECT DISTINCT
|
let accountPassword
|
||||||
userAccounts.username,
|
|
||||||
userAccounts.password,
|
|
||||||
userAccounts.userID
|
|
||||||
FROM users,
|
|
||||||
userAccounts,
|
|
||||||
streams
|
|
||||||
WHERE userAccounts.userID = ${userId} AND userAccounts.username = '${userAccUser}'`)
|
|
||||||
|
|
||||||
|
accountPassword = sql.query(`SELECT DISTINCT
|
||||||
|
userAccounts.username,
|
||||||
|
userAccounts.password,
|
||||||
|
userAccounts.userID
|
||||||
|
FROM users,
|
||||||
|
userAccounts,
|
||||||
|
streams
|
||||||
|
WHERE userAccounts.userID = ${userId} AND userAccounts.username = '${userAccUser}'`)
|
||||||
|
|
||||||
|
if (accountPassword == 0) {
|
||||||
|
throw new Error('Account ' + userAccUser + ' not found for user ' + user)
|
||||||
|
} else {
|
||||||
const decryptedString = cryptr.decrypt(accountPassword[0].password);
|
const decryptedString = cryptr.decrypt(accountPassword[0].password);
|
||||||
console.log(decryptedString)
|
console.log(decryptedString)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// storePasswordToDB('kcshkzex')
|
retrievePasswordFromDB('Karl', 'Karl2903')
|
||||||
|
|
||||||
// retrievePasswordFromDB('Karl', 'Karl0820')
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
storeAccountToDB,
|
storeAccountToDB,
|
||||||
|
@ -1 +1 @@
|
|||||||
[{"StreamName":"Insanity","StreamURL":"https://trippy.pro:443"},{"StreamName":"PremPlus","StreamURL":"https://itty.in:443"},{"StreamName":"GunSlinger","StreamURL":"http://gunslingertv.org:8080"},{"StreamName":"VIP","StreamURL":"http://oven-cleaner.com:8080/"},{"StreamName":"Technoid","StreamURL":"http://capoisagod2021.org:8080"},{"StreamName":"Old Premium","StreamURL":"https://caporeds.online:443","username":"Dazg3012","expiaryDate":"12/30/2021"},{"StreamName":"??","StreamURL":"http://screamstreams.info:8080"},{"StreamName":"Gold","StreamURL":"http://catenamode.cf:8090"},{"StreamName":"??","StreamURL":"http://sulu.xyz:2086"},{"StreamName":"??","StreamURL":"http://bigbox.me.uk:2086"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"https://hulks.xyz:443"},{"StreamName":"??","StreamURL":"http://mytv.digital:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"Gold","StreamURL":"http://server1.jforbes.club:8090"},{"StreamName":"??","StreamURL":"http://ths.viewdns.net:8080"},{"StreamName":"??","StreamURL":"http://vpsuk.store:8080"},{"StreamName":"??","StreamURL":"http://ac.mustardsubs.tk:8880"},{"StreamName":"??","StreamURL":"http://faithhosting.xyz:25461"},{"StreamName":"??","StreamURL":"http://ip365.cx:80"},{"StreamName":"??","StreamURL":"http://g132.caporeds.online:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"http://pimptv.dnsabr.com:8080"},{"StreamName":"??","StreamURL":"http://tavaratv.xyz:2095"},{"StreamName":"??","StreamURL":"http://cms-tan.media:8880"},{"StreamName":"??","StreamURL":"http://streamknighttv.xyz:8080"},{"StreamName":"??","StreamURL":"http://covidsucks.xyz:8080"},{"StreamName":"??","StreamURL":"http://fckbrexit.link:8080"},{"StreamName":"Gambler","StreamURL":"http://tv.realot.xyz:35001"},{"StreamName":"??","StreamURL":"http://www.tvxclnt.com:8080"},{"StreamName":"??","StreamURL":"http://iptv.satplex.co.uk:8080"},{"StreamName":"??","StreamURL":"http://37723998.to:2052"}]
|
[{"StreamName":"Insanity","StreamURL":"https://trippy.pro:443"},{"StreamName":"PremPlus","StreamURL":"https://itty.in:443"},{"StreamName":"GunSlinger","StreamURL":"http://gunslingertv.org:8080"},{"StreamName":"VIP","StreamURL":"http://oven-cleaner.com:8080/"},{"StreamName":"Technoid","StreamURL":"http://capoisagod2021.org:8080"},{"StreamName":"Old Premium","StreamURL":"https://caporeds.online:443","username":"Dazg3012","expiaryDate":"12/30/2021"},{"StreamName":"??","StreamURL":"http://screamstreams.info:8080"},{"StreamName":"Gold","StreamURL":"http://catenamode.cf:8090"},{"StreamName":"??","StreamURL":"http://sulu.xyz:2086"},{"StreamName":"??","StreamURL":"http://bigbox.me.uk:2086"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"https://hulks.xyz:443"},{"StreamName":"??","StreamURL":"http://mytv.digital:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"Gold","StreamURL":"http://server1.jforbes.club:8090"},{"StreamName":"??","StreamURL":"http://ths.viewdns.net:8080"},{"StreamName":"??","StreamURL":"http://vpsuk.store:8080"},{"StreamName":"??","StreamURL":"http://ac.mustardsubs.tk:8880"},{"StreamName":"??","StreamURL":"http://faithhosting.xyz:25461"},{"StreamName":"??","StreamURL":"http://ip365.cx:80"},{"StreamName":"??","StreamURL":"https://trippy.pro:443"},{"StreamName":"??","StreamURL":"http://g132.caporeds.online:8080/"},{"StreamName":"??","StreamURL":"http://theonlinemedia.network:2052"},{"StreamName":"??","StreamURL":"http://beautifilm.xyz:8080"},{"StreamName":"??","StreamURL":"http://pimptv.dnsabr.com:8080"},{"StreamName":"??","StreamURL":"http://tavaratv.xyz:2095"},{"StreamName":"??","StreamURL":"http://cms-tan.media:8880"},{"StreamName":"??","StreamURL":"http://streamknighttv.xyz:8080"},{"StreamName":"??","StreamURL":"http://covidsucks.xyz:8080"},{"StreamName":"Gambler","StreamURL":"http://fckbrexit.link:8080"},{"StreamName":"??","StreamURL":"http://tv.realot.xyz:35001"},{"StreamName":"??","StreamURL":"http://www.tvxclnt.com:8080"},{"StreamName":"??","StreamURL":"http://iptv.satplex.co.uk:8080"}]
|
13
package-lock.json
generated
13
package-lock.json
generated
@ -125,6 +125,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz",
|
||||||
"integrity": "sha1-sqRdpf36ILBJb8N2jMJ8EvqRan0="
|
"integrity": "sha1-sqRdpf36ILBJb8N2jMJ8EvqRan0="
|
||||||
},
|
},
|
||||||
|
"axios": {
|
||||||
|
"version": "0.21.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
|
||||||
|
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
||||||
|
"requires": {
|
||||||
|
"follow-redirects": "^1.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"babel-runtime": {
|
"babel-runtime": {
|
||||||
"version": "6.26.0",
|
"version": "6.26.0",
|
||||||
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
|
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
|
||||||
@ -546,6 +554,11 @@
|
|||||||
"unpipe": "~1.0.0"
|
"unpipe": "~1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"follow-redirects": {
|
||||||
|
"version": "1.13.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz",
|
||||||
|
"integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA=="
|
||||||
|
},
|
||||||
"forwarded": {
|
"forwarded": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
"start": "node ./bin/www"
|
"start": "node ./bin/www"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"axios": "^0.21.1",
|
||||||
"bcrypt": "^5.0.0",
|
"bcrypt": "^5.0.0",
|
||||||
"cookie-parser": "~1.4.4",
|
"cookie-parser": "~1.4.4",
|
||||||
"cryptr": "^6.0.2",
|
"cryptr": "^6.0.2",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user