working with app
This commit is contained in:
parent
f7826664a9
commit
10a9f9da52
32
.vscode/launch.json
vendored
32
.vscode/launch.json
vendored
@ -21,10 +21,11 @@
|
||||
],
|
||||
"program": "${workspaceFolder}/bin/www",
|
||||
"env": {
|
||||
"HOST": "localhost",
|
||||
"DBHOST": "vps.k-world.me.uk",
|
||||
"DBUSER": "root",
|
||||
"DBPASS": "example",
|
||||
"DATABASE":"BBLB_DNS"
|
||||
"DBPASS": "Grd555269",
|
||||
"DATABASE": "BBLB_DNS",
|
||||
"DBPORT": "3306",
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -36,10 +37,27 @@
|
||||
],
|
||||
"program": "${workspaceFolder}/lib/checker.js",
|
||||
"env": {
|
||||
"HOST": "localhost",
|
||||
"DBHOST": "vps.k-world.me.uk",
|
||||
"DBUSER": "root",
|
||||
"DBPASS": "example",
|
||||
"DATABASE":"BBLB_DNS"
|
||||
"DBPASS": "Grd555269",
|
||||
"DATABASE": "BBLB_DNS",
|
||||
"DBPORT": "3306",
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "AddAcccount",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"program": "${workspaceFolder}/lib/addAccounts.js",
|
||||
"env": {
|
||||
"DBHOST": "vps.k-world.me.uk",
|
||||
"DBUSER": "root",
|
||||
"DBPASS": "Grd555269",
|
||||
"DATABASE": "BBLB_DNS",
|
||||
"DBPORT": "3306",
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -54,7 +72,7 @@
|
||||
"HOST": "localhost",
|
||||
"DBUSER": "root",
|
||||
"DBPASS": "example",
|
||||
"DATABASE":"BBLB_DNS"
|
||||
"DATABASE": "BBLB_DNS"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
2
.vscode/settings.json
vendored
Normal file
2
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
12
app.js
12
app.js
@ -12,6 +12,7 @@ var streamsRouter = require('./routes/getStreams');
|
||||
var getUserAccounts = require('./routes/getUserAccounts')
|
||||
var singleUserCheck = require('./routes/singleCheck')
|
||||
var addAccount = require('./routes/addAccount')
|
||||
var deleteAccount = require('./routes/deleteAccount')
|
||||
var readCookie = require('./routes/readCookie')
|
||||
var getStreamNames = require('./routes/getStreamNames')
|
||||
var login = require('./routes/login')
|
||||
@ -39,12 +40,13 @@ const users = {
|
||||
|
||||
app.use('/', indexRouter);
|
||||
app.use('/login', basicAuth(users), login)
|
||||
app.use('/getStreams', streamsRouter);
|
||||
app.use('/getUserAccounts', getUserAccounts);
|
||||
// app.use('/getStreams', streamsRouter);
|
||||
app.use('/getUserAccounts', basicAuth(users), getUserAccounts);
|
||||
app.use('/singleCheck', basicAuth(users), singleUserCheck)
|
||||
app.use('/addAccount', addAccount)
|
||||
app.use('/readCookie', readCookie)
|
||||
app.use('/getStreamNames', getStreamNames)
|
||||
app.use('/addAccount', basicAuth(users), addAccount)
|
||||
app.use('/deleteAccount', basicAuth(users), deleteAccount)
|
||||
// app.use('/readCookie', readCookie)
|
||||
// app.use('/getStreamNames', getStreamNames)
|
||||
|
||||
|
||||
// catch 404 and forward to error handler
|
||||
|
8
client/package-lock.json
generated
8
client/package-lock.json
generated
@ -1910,14 +1910,6 @@
|
||||
"@testing-library/dom": "^7.28.1"
|
||||
}
|
||||
},
|
||||
"@testing-library/user-event": {
|
||||
"version": "12.7.3",
|
||||
"resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.7.3.tgz",
|
||||
"integrity": "sha512-IdSHkWfbeSSJRFlldvHDWfVX0U18TbXIvLSGII+JbqkJrsflFr4OWlQIua0TvcVVJNna3BNrNvRSvpQ0yvSXlA==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.12.5"
|
||||
}
|
||||
},
|
||||
"@types/anymatch": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz",
|
||||
|
@ -20,6 +20,7 @@ services:
|
||||
build:
|
||||
context: ./client
|
||||
dockerfile: Dockerfile.prod
|
||||
# dockerfile: .dockerfile
|
||||
image: "karl0ss/bblbtv_dns-frontend"
|
||||
ports:
|
||||
- "6969:6969"
|
||||
|
@ -5,10 +5,19 @@ const sql = require('./mysql')
|
||||
|
||||
function storeAccountToDB(accountDetails) {
|
||||
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, expiaryDate) VALUES ("${accountDetails.username}", "${encryptedPassword}", "${accountDetails.stream}", ${accountDetails.userId}, 123)`);
|
||||
return result
|
||||
}
|
||||
|
||||
function removeAccountFromDB(accountDetails) {
|
||||
const result = sql.query(`DELETE FROM userAccounts WHERE
|
||||
username = '${accountDetails.user}' AND
|
||||
stream = '${accountDetails.stream}' AND
|
||||
userId = ${accountDetails.userId} `);
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
function retrievePasswordFromDB(user, userAccUser) {
|
||||
let userId
|
||||
try {
|
||||
@ -39,11 +48,20 @@ WHERE userAccounts.userID = ${userId} AND userAccounts.username = '${userAccUser
|
||||
}
|
||||
}
|
||||
|
||||
// accountDetails = {
|
||||
// "username": "Darren110921",
|
||||
// "password" :"saD2V2kjyNqH",
|
||||
// "stream": "Badger",
|
||||
// "userId" : "2"
|
||||
// }
|
||||
|
||||
|
||||
// retrievePasswordFromDB('Karl', 'Karl2903')
|
||||
|
||||
// retrievePasswordFromDB('Karl', 'Maxine2206')
|
||||
// storeAccountToDB(accountDetails)
|
||||
|
||||
module.exports = {
|
||||
removeAccountFromDB,
|
||||
storeAccountToDB,
|
||||
retrievePasswordFromDB
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
[
|
||||
"http://webservgroup.xyz/smarters4567891/api/home.php?action=dns",
|
||||
"https://topsapp.xyz/SMARTERS/scotslad/api/home.php?action=dns"
|
||||
"http://panelhost.xyz/cli3nts/Funky/Smarters/api/home.php?action=dns"
|
||||
]
|
137
lib/checker.js
137
lib/checker.js
@ -11,7 +11,11 @@ const { gotRequest } = require('./gotRequest')
|
||||
|
||||
const { decryptPassword } = require('./password')
|
||||
|
||||
const { getAllUserAccounts } = require('./getUser')
|
||||
const { getAllUserAccounts, getUserAccountsCheck } = require('./getUser')
|
||||
|
||||
const { setExpired } = require('./setExpired')
|
||||
|
||||
const { removeAccountFromDB } = require('../lib/Accounts')
|
||||
|
||||
const delay = ms => new Promise(res => setTimeout(res, ms));
|
||||
|
||||
@ -82,20 +86,21 @@ async function newCheck() {
|
||||
return user
|
||||
})
|
||||
for (let userAccount of userAccounts) {
|
||||
console.log(userAccount.username, userAccount.passwordDecryped)
|
||||
if (userAccount.expiaryDate != 123 && Math.round(Date.now() / 1000) > userAccount.expiaryDate) {
|
||||
setExpired(userAccount)
|
||||
} else {
|
||||
for (let streamURL of streamURLS) {
|
||||
process.stdout.write('.')
|
||||
let url = await buildURL(streamURL, userAccount.username, userAccount.passwordDecryped)
|
||||
// console.log(url)
|
||||
let t = await gotRequest(url)
|
||||
let body = t.body
|
||||
if (t.statusCode == 200 && body !== "") {
|
||||
try {
|
||||
body = JSON.parse(body)
|
||||
if (body.user_info.auth) {
|
||||
// var date = new Date(body.user_info.exp_date * 1000).toLocaleDateString('en-GB')
|
||||
process.stdout.write('\n')
|
||||
console.log(`Match - ${userAccount.username} - ${streamURL} - Expires - ${body.user_info.exp_date}`)
|
||||
var date = new Date(body.user_info.exp_date * 1000).toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
|
||||
// process.stdout.write('\n')
|
||||
console.log(`${userAccount.username} - ${userAccount.stream} - ${streamURL} - Expires ${date}.`)
|
||||
await updateStreamData(userAccount, streamURL, body.user_info.exp_date)
|
||||
break
|
||||
}
|
||||
@ -104,14 +109,130 @@ async function newCheck() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function newUserCheck(accountData) {
|
||||
streamURLS = await getStreamsNew()
|
||||
let userAccounts = await getUserAccountsCheck(accountData.userId)
|
||||
userAccounts = userAccounts.map(user => {
|
||||
user.passwordDecryped = decryptPassword(user.password)
|
||||
return user
|
||||
})
|
||||
|
||||
for (let userAccount of userAccounts) {
|
||||
if (userAccount.expiaryDate != 123 && Math.round(Date.now() / 1000) > userAccount.expiaryDate) {
|
||||
setExpired(userAccount)
|
||||
} else {
|
||||
for (let streamURL of streamURLS) {
|
||||
process.stdout.write('.')
|
||||
let url = await buildURL(streamURL, userAccount.username, userAccount.passwordDecryped)
|
||||
let t = await gotRequest(url)
|
||||
let body = t.body
|
||||
if (t.statusCode == 200 && body !== "") {
|
||||
try {
|
||||
body = JSON.parse(body)
|
||||
if (body.user_info.auth) {
|
||||
var date = new Date(body.user_info.exp_date * 1000).toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
|
||||
// process.stdout.write('\n')
|
||||
console.log(`${userAccount.username} - ${userAccount.stream} - ${streamURL} - Expires ${date}.`)
|
||||
await updateStreamData(userAccount, streamURL, body.user_info.exp_date)
|
||||
break
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
async function newSingleCheck(accountData) {
|
||||
streamURLS = await getStreamsNew()
|
||||
let userAccounts = await getUserAccountsCheck(accountData.userId)
|
||||
userAccounts = userAccounts.map(user => {
|
||||
user.passwordDecryped = decryptPassword(user.password)
|
||||
return user
|
||||
})
|
||||
var result = userAccounts.filter(obj => {
|
||||
return obj.username === accountData.username && obj.passwordDecryped === accountData.password && obj.stream === accountData.stream
|
||||
})
|
||||
|
||||
for (let userAccount of result) {
|
||||
if (userAccount.expiaryDate != 123 && Math.round(Date.now() / 1000) > userAccount.expiaryDate) {
|
||||
setExpired(userAccount)
|
||||
} else {
|
||||
for (let streamURL of streamURLS) {
|
||||
process.stdout.write('.')
|
||||
let url = await buildURL(streamURL, userAccount.username, userAccount.passwordDecryped)
|
||||
let t = await gotRequest(url)
|
||||
let body = t.body
|
||||
if (t.statusCode == 200 && body !== "") {
|
||||
try {
|
||||
body = JSON.parse(body)
|
||||
if (body.user_info.auth) {
|
||||
var date = new Date(body.user_info.exp_date * 1000).toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
|
||||
// process.stdout.write('\n')
|
||||
console.log(`${userAccount.username} - ${userAccount.stream} - ${streamURL} - Expires ${date}.`)
|
||||
await updateStreamData(userAccount, streamURL, body.user_info.exp_date)
|
||||
return true
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
removeAccountFromDB({
|
||||
"user": userAccount.username,
|
||||
"stream": userAccount.stream,
|
||||
"userId": accountData.userId
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// async function newSingleCheck(userData) {
|
||||
// streamURLS = await getStreamsNew()
|
||||
// for (let streamURL of streamURLS) {
|
||||
// process.stdout.write('.')
|
||||
// let url = await buildURL(streamURL, userData.username, userData.password)
|
||||
// // console.log(url)
|
||||
// let t = await gotRequest(url)
|
||||
// let body = t.body
|
||||
// if (t.statusCode == 200 && body !== "") {
|
||||
// try {
|
||||
// body = JSON.parse(body)
|
||||
// if (body.user_info.auth) {
|
||||
// // var date = new Date(body.user_info.exp_date * 1000).toLocaleDateString('en-GB')
|
||||
// // process.stdout.write('\n')
|
||||
// await updateStreamData(userAccount, streamURL, body.user_info.exp_date)
|
||||
// console.log(`Match - ${username} - ${streamURL} - Expires - ${body.user_info.exp_date}`)
|
||||
// return (`Match - ${username} - ${streamURL} - Expires - ${body.user_info.exp_date}`)
|
||||
// // break
|
||||
// }
|
||||
// } catch (error) {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // }
|
||||
|
||||
|
||||
// main()
|
||||
// singleCheck('Karl2903')
|
||||
newCheck()
|
||||
// newCheck()
|
||||
// newSingleCheck('Karl1607', 'Ybkjqszr1z')
|
||||
|
||||
module.exports = {
|
||||
newCheck,
|
||||
singleCheck,
|
||||
main
|
||||
main,
|
||||
newSingleCheck,
|
||||
newUserCheck
|
||||
}
|
@ -3,14 +3,31 @@ const sql = require('./mysql')
|
||||
function getUserAccounts(user) {
|
||||
let data = sql.query(`SELECT
|
||||
userAccounts.username,
|
||||
streams.streamName,
|
||||
streams.streamURL,
|
||||
userAccounts.stream,
|
||||
userAccounts.streamURL,
|
||||
userAccounts.expiaryDate
|
||||
FROM users
|
||||
INNER JOIN userAccounts
|
||||
ON users.id = userAccounts.userID
|
||||
INNER JOIN streams
|
||||
ON userAccounts.stream = streams.streamName
|
||||
WHERE users.id = '${user}'`)
|
||||
// console.log(data)
|
||||
if (data.length == 0) {
|
||||
return 'User Not Found'
|
||||
} else {
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
function getUserAccountsCheck(user) {
|
||||
let data = sql.query(`SELECT
|
||||
userAccounts.username,
|
||||
userAccounts.stream,
|
||||
userAccounts.streamURL,
|
||||
userAccounts.expiaryDate,
|
||||
userAccounts.password
|
||||
FROM users
|
||||
INNER JOIN userAccounts
|
||||
ON users.id = userAccounts.userID
|
||||
WHERE users.id = '${user}'`)
|
||||
// console.log(data)
|
||||
if (data.length == 0) {
|
||||
@ -23,8 +40,12 @@ function getUserAccounts(user) {
|
||||
function getAllUserAccounts() {
|
||||
let data = sql.query(`SELECT
|
||||
userAccounts.username,
|
||||
userAccounts.password
|
||||
userAccounts.password,
|
||||
userAccounts.expiaryDate,
|
||||
userAccounts.stream
|
||||
FROM userAccounts
|
||||
WHERE userAccounts.expiaryDate != '0'
|
||||
ORDER BY userAccounts.id DESC
|
||||
`)
|
||||
// console.log(data)
|
||||
if (data.length == 0) {
|
||||
@ -34,8 +55,21 @@ FROM userAccounts
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getUserAccounts,
|
||||
getAllUserAccounts
|
||||
function getUserId(user) {
|
||||
let data = sql.query(`SELECT id FROM users WHERE userName = '${user}'`)
|
||||
// console.log(data)
|
||||
if (data.length == 0) {
|
||||
return 'User Not Found'
|
||||
} else {
|
||||
return data[0].id
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
getUserAccounts,
|
||||
getAllUserAccounts,
|
||||
getUserId,
|
||||
getUserAccountsCheck
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ const sql = require('./mysql')
|
||||
|
||||
function getUsers() {
|
||||
let data = sql.query(`SELECT
|
||||
|
||||
userName,
|
||||
password
|
||||
FROM users
|
||||
|
@ -1,4 +0,0 @@
|
||||
[
|
||||
"https://trippy.pro:443",
|
||||
"https://itty.in:443"
|
||||
]
|
7
lib/otherURLs.json
Normal file
7
lib/otherURLs.json
Normal file
@ -0,0 +1,7 @@
|
||||
[
|
||||
"https://trippy.pro:443",
|
||||
"https://itty.in:443",
|
||||
"https://tictacs.win",
|
||||
"http://sting.ltd:25461",
|
||||
"http://37723998.to:2052"
|
||||
]
|
17
lib/setExpired.js
Normal file
17
lib/setExpired.js
Normal file
@ -0,0 +1,17 @@
|
||||
const sql = require('./mysql')
|
||||
|
||||
function setExpired(userAccount) {
|
||||
console.log(userAccount.username + ' ' + userAccount.stream + ' Expired on ' + userAccount.expiaryDate.toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }))
|
||||
let result
|
||||
try {
|
||||
result = sql.query(`UPDATE userAccounts SET expiaryDate = "0" WHERE username = "${userAccount.username}" AND password = "${userAccount.password}"; `);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
setExpired
|
||||
}
|
||||
|
@ -1,20 +1,28 @@
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
const { storeAccountToDB } = require('../lib/addAccounts')
|
||||
const { getUserName } = require('../lib/getUsers')
|
||||
const { storeAccountToDB } = require('../lib/Accounts')
|
||||
const { getUserId } = require('../lib/getUser')
|
||||
const { newSingleCheck } = require('../lib/checker')
|
||||
|
||||
|
||||
|
||||
/* POST postUser page. */
|
||||
router.post('/', async function (req, res, next) {
|
||||
let postData = req.body
|
||||
postData.userId = Number(req.signedCookies.user)
|
||||
let userName = await getUserName(req.signedCookies.user)
|
||||
postData.userId = getUserId(req.auth.user)
|
||||
let userName = req.auth.user
|
||||
let result = await storeAccountToDB(postData)
|
||||
console.log(result)
|
||||
if (result.affectedRows < 1) {
|
||||
res.send('Adding account failed')
|
||||
} else {
|
||||
a = await newSingleCheck(postData)
|
||||
if (a) {
|
||||
res.send('Account ' + postData.username + ' Added successfully to ' + userName)
|
||||
} else {
|
||||
res.send(500);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
22
routes/deleteAccount.js
Normal file
22
routes/deleteAccount.js
Normal file
@ -0,0 +1,22 @@
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
const { removeAccountFromDB} = require('../lib/Accounts')
|
||||
const { getUserId } = require('../lib/getUser')
|
||||
|
||||
|
||||
/* POST postUser page. */
|
||||
router.post('/', async function (req, res, next) {
|
||||
let postData = req.body
|
||||
postData.userId = getUserId(req.auth.user)
|
||||
let userName = req.auth.user
|
||||
let result = await removeAccountFromDB(postData)
|
||||
console.log(result)
|
||||
if (result.affectedRows < 1) {
|
||||
res.send('Adding account failed')
|
||||
} else {
|
||||
res.send('Account ' + postData.username + ' Deleted from ' + userName)
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
@ -4,7 +4,7 @@ const fs = require('fs');
|
||||
|
||||
let DNSArray = require('../lib/DNSArray.json')
|
||||
let streamArrays = require('../lib/streamArray.json')
|
||||
const otherDNS = require('../lib/otherDNS.json')
|
||||
const otherURLs = require('../lib/otherURLs.json')
|
||||
|
||||
const { gotRequest } = require('../lib/gotRequest')
|
||||
|
||||
@ -54,12 +54,17 @@ async function getStreamsNew() {
|
||||
for (let index = 0; index < DNSArray.length; index++) {
|
||||
const url = DNSArray[index];
|
||||
requestData = await gotRequest(url)
|
||||
let DNSList = JSON.parse(requestData.body)
|
||||
let DNSList = requestData.body
|
||||
if (typeof DNSList === 'string' || DNSList instanceof String) {
|
||||
DNSList = JSON.parse(DNSList)
|
||||
}
|
||||
DNSList = splitToArray(DNSList.su)
|
||||
DNSList.forEach(url => {
|
||||
jointArray.push(url)
|
||||
});
|
||||
}
|
||||
jointArray.unshift(...otherURLs)
|
||||
|
||||
return jointArray
|
||||
}
|
||||
/* GET users listing. */
|
||||
@ -71,4 +76,3 @@ router.get('/', async function (req, res, next) {
|
||||
module.exports = {
|
||||
router, getStreams, getStreamsNew
|
||||
}
|
||||
;
|
@ -1,16 +1,13 @@
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
const { getUserAccounts } = require('../lib/getUser')
|
||||
const { getUserAccounts, getUserId } = require('../lib/getUser')
|
||||
|
||||
/* POST postUser page. */
|
||||
router.get('/', async function (req, res, next) {
|
||||
if (req.cookies.user === undefined) {
|
||||
res.send('Cookie Not Set')
|
||||
} else {
|
||||
let data = await getUserAccounts(req.cookies.user)
|
||||
let userId = await getUserId(req.auth.user)
|
||||
let data = await getUserAccounts(userId)
|
||||
res.send(data)
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
@ -1,14 +1,21 @@
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
const { singleCheck } = require('../lib/checker')
|
||||
const { storeAccountToDB } = require('../lib/Accounts')
|
||||
const { getUserId } = require('../lib/getUser')
|
||||
const { newUserCheck } = require('../lib/checker')
|
||||
|
||||
/* POST postUser page. */
|
||||
router.post('/', async function (req, res, next) {
|
||||
let postedUsername = req.body.username
|
||||
|
||||
let data = await singleCheck(postedUsername)
|
||||
|
||||
res.send(data);
|
||||
router.get('/', async function (req, res, next) {
|
||||
let postData = req.body
|
||||
postData.userId = getUserId(req.auth.user)
|
||||
a = await newUserCheck(postData)
|
||||
if (a) {
|
||||
res.send(200)
|
||||
} else {
|
||||
res.send(500);
|
||||
}
|
||||
// }
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
Loading…
x
Reference in New Issue
Block a user