mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Showing info on get veteran pw when client id starts with zero
This commit is contained in:
parent
6179ad7f95
commit
34f44a0fa2
2 changed files with 24 additions and 3 deletions
|
@ -187,7 +187,8 @@ function GetApp () {
|
||||||
|
|
||||||
app.get('/getVeteranPw', function (req, res) {
|
app.get('/getVeteranPw', function (req, res) {
|
||||||
res.render('veteranPw', {
|
res.render('veteranPw', {
|
||||||
cid: req.query.cid || ''
|
cid: req.query.cid || '',
|
||||||
|
devel: process.env.NS_DEVEL
|
||||||
})
|
})
|
||||||
logger.LogReq(req)
|
logger.LogReq(req)
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=0.6" />
|
<meta name="viewport" content="width=device-width, initial-scale=0.6" />
|
||||||
<style>
|
<style>
|
||||||
|
a {
|
||||||
|
color: lightblue;
|
||||||
|
}
|
||||||
.center {
|
.center {
|
||||||
width: 440px;
|
width: 440px;
|
||||||
height: 340px;
|
height: 340px;
|
||||||
|
@ -63,6 +66,9 @@
|
||||||
margin: 4px 2px;
|
margin: 4px 2px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
#irc {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<div class='center'>
|
<div class='center'>
|
||||||
|
@ -73,6 +79,9 @@
|
||||||
Másold be ide régi kliens ID-d, és az alapján jelszót kapsz. Ezt csak egyszer teheted meg,
|
Másold be ide régi kliens ID-d, és az alapján jelszót kapsz. Ezt csak egyszer teheted meg,
|
||||||
ezért a kapott jelszót tuti helyre írd le!
|
ezért a kapott jelszót tuti helyre írd le!
|
||||||
</div>
|
</div>
|
||||||
|
<div id='irc'>
|
||||||
|
<a class='ircLink' href='<%= devel? 'http' : 'https' %>://qmining.frylabs.net/irc?loginClick'>IRC</a>
|
||||||
|
</div>
|
||||||
<div id='form'>
|
<div id='form'>
|
||||||
<div class='inputContainer'>
|
<div class='inputContainer'>
|
||||||
<input type='text' id='cid' name='pw' value='<%= cid %>' autocomplete="off"/>
|
<input type='text' id='cid' name='pw' value='<%= cid %>' autocomplete="off"/>
|
||||||
|
@ -98,9 +107,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function HandleZeroStart () {
|
||||||
|
document.getElementById('form').style.display = 'none'
|
||||||
|
document.getElementById('irc').style.display = 'block'
|
||||||
|
document.getElementById('text').innerText = 'Client ID-d 0-val kezdődik. Ez azt jelenti hogy a jelszavasítás után telepítetted a scriptet, ezért nem vagy jogosult itt jelszót kérni. Ennek ellenére más felhasználóktól (akiknek már van jelszavuk) kérhetsz. Ha úgy gondolod valami nem stimmel:'
|
||||||
|
}
|
||||||
|
|
||||||
async function GetVeteranPW(button) {
|
async function GetVeteranPW(button) {
|
||||||
button.innerText = '...'
|
button.innerText = '...'
|
||||||
const rawResponse = await fetch('https://api.frylabs.net/getveteranpw', {
|
const cid = document.getElementById('cid').value
|
||||||
|
if (cid[0] === '0') {
|
||||||
|
HandleZeroStart()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const rawResponse = await fetch('<%= devel? 'http' : 'https' %>://api.frylabs.net/getveteranpw', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -108,7 +128,7 @@
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
cid: document.getElementById('cid').value
|
cid: cid
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if (!rawResponse.ok) {
|
if (!rawResponse.ok) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue