fix launching private

This commit is contained in:
SpikeHD 2022-04-27 21:17:22 -07:00
parent b70fdd7ff6
commit 69c43200e7
2 changed files with 9 additions and 2 deletions

View File

@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<link rel="stylesheet" type="text/css" href="style/index.css" /> <link rel="stylesheet" type="text/css" href="style/index.css" />
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="js/neutralino.js"></script> <script src="js/neutralino.js"></script>
<script src="js/windowDrag.js"></script> <script src="js/windowDrag.js"></script>
<script src="js/hoverEvt.js"></script> <script src="js/hoverEvt.js"></script>

View File

@ -296,13 +296,19 @@ async function openLogin() {
const url = `${useHttps ? 'https' : 'http'}://${ip}:${port}`; const url = `${useHttps ? 'https' : 'http'}://${ip}:${port}`;
// Check if we even need to authenticate // Check if we even need to authenticate
const { data } = await axios.get(url + '/grasscutter/auth_status') try {
const { data } = await axios.get(url + '/grasscutter/auth_status')
if (data?.message !== 'AUTH_ENABLED') { if (data?.message !== 'AUTH_ENABLED') {
launchPrivate()
return
}
} catch(e) {
launchPrivate() launchPrivate()
return return
} }
loginIpDisplay.innerText = ip loginIpDisplay.innerText = ip
registerIpDisplay.innerText = ip registerIpDisplay.innerText = ip