Skip to content

Commit

Permalink
I can't remember whether auto-auth even works no remove it for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Heath123 committed Mar 16, 2023
1 parent 1404e85 commit 41c6a76
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions html/startPage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ <h1 class='title'>pakkit</h1>
<label for="listen-port">Listen port:</label>
<input id="listen-port" name="listen-port" placeholder="25566" type="text" value="25566"/>
</li>
<li class="form-row" id="consent-row" style="display: none;">
<!-- <li class="form-row" id="consent-row" style="display: none;">
<label for="consent">Consent:<br>
<label class="switch" style="padding: 0;">
<input id="consent" type="checkbox" value="consent"/>
<span class="slider round"></span>
</label>
</label>
<p>Allow pakkit to use my auth token from launcher_profiles.json for logging in to online mode servers.</p>
</li>
</li> -->
<li class="form-row">
<label></label>
<span class="start"><input id="start" type="submit" value="Start!"/></span>
Expand Down
13 changes: 7 additions & 6 deletions html/startPage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#FFF')
}); */

if (!store.get('authConsentGiven')) {
document.getElementById('consent-row').style.display = 'flex'
}
// if (!store.get('authConsentGiven')) {
// document.getElementById('consent-row').style.display = 'flex'
// }

let isLoading = false
let connectAddress
Expand Down Expand Up @@ -107,9 +107,10 @@ window.startProxy = function (event)
connectPort = (connectPort === '') ? '25565' : connectPort
listenPort = (listenPort === '') ? '25566' : listenPort
}
if (document.getElementById('consent').checked) {
store.set('authConsentGiven', true)
}
// if (document.getElementById('consent').checked) {
// store.set('authConsentGiven', true)
// }
store.set('authConsentGiven', false)
// TODO: Validate data (e.g. port range)
ipcRenderer.send('startProxy', JSON.stringify({
consent: store.get('authConsentGiven'),
Expand Down
11 changes: 6 additions & 5 deletions src/proxy/java/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ let authWindowOpen = false
exports.startProxy = function (host, port, listenPort, version, onlineMode, authConsent, callback, messageCallback, dataFolder,
updateFilteringCallback, authCodeCallback) {
storedCallback = callback
authConsent = false

// . cannot be in a JSON property name with electron-store
exports.capabilities.versionId = 'java-node-minecraft-protocol-' + version.split('.').join('-')
Expand Down Expand Up @@ -107,11 +108,11 @@ exports.startProxy = function (host, port, listenPort, version, onlineMode, auth
console.log(err.stack)
if (!endedTargetClient) { targetClient.end('Error') }
})
if (authConsent) {
console.log('Will attempt to use launcher_profiles.json for online mode login data')
} else {
console.warn('Consent not given to use launcher_profiles.json - automatic online mode will not work')
}
// if (authConsent) {
// console.log('Will attempt to use launcher_profiles.json for online mode login data')
// } else {
// console.warn('Consent not given to use launcher_profiles.json - automatic online mode will not work')
// }
const clientOptions = {
host: host,
port: port,
Expand Down

0 comments on commit 41c6a76

Please sign in to comment.