Redirect to get veteran client id if user has client ID

This commit is contained in:
MrFry 2020-04-08 17:46:33 +02:00
parent edbafe3d8a
commit 5ffcdcaf85

View file

@ -63,7 +63,7 @@
const serverAdress = 'https://qmining.frylabs.net/'
// const serverAdress = 'http://localhost:8080/'
// const apiAdress = 'https://api.frylabs.net/'
const apiAdress = 'http://localhost:8080/'
const apiAdress = 'http://localhost:80/'
const ircAddress = 'https://kiwiirc.com/nextclient/irc.sub.fm/#qmining'
// forcing pages for testing. unless you test, do not set these to true!
@ -661,7 +661,11 @@
// : Loading {{{
function HandleQminingSite (url) {
try {
Array.from(document.getElementById('sideBarLinks').childNodes).forEach((link) => {
const sideLinks = document.getElementById('sideBarLinks')
if (!sideLinks) {
return
}
Array.from(sideLinks.childNodes).forEach((link) => {
link.addEventListener('mousedown', () => {
FillFeedbackCID(url, link)
})
@ -1549,6 +1553,8 @@
loginButton.innerText = 'Login'
const loginInput = document.createElement('input')
loginInput.type = 'text'
loginInput.style.textAlign = 'center'
loginInput.value = getVal('clientId') || ''
loginDiv.appendChild(loginInput)
loginDiv.appendChild(loginButton)
@ -1556,7 +1562,14 @@
SetStyle(loginButton, buttonStyle)
loginButton.addEventListener('click', function () {
if (loginInput.value === getVal('clientId').toString()) {
console.log('opening veteran pw page ...')
openInTab(serverAdress + 'getVeteranPw?cid=' + getVal('clientId'), {
active: true
})
} else {
Auth(loginInput.value)
}
})
ibuttonCell.appendChild(loginDiv)