Securely (or as secure as it can be) store encryption keys

This commit is contained in:
2025-07-22 17:44:14 -07:00
parent c507a6fbe4
commit 49b5441136
8 changed files with 103 additions and 64 deletions

View File

@@ -14,21 +14,22 @@ export default function Leaderboards () {
async function refresh () {
setLoading(true)
setLeaderboardData([])
const launcherVersion = await app.getVersion()
axios
.get('https://berrydash.lncvrt.xyz/database/getTopPlayers.php', {
try {
const launcherVersion = await app.getVersion()
const response = await axios.get('https://berrydash.lncvrt.xyz/database/getTopPlayers.php', {
headers: {
Requester: 'BerryDashLauncher',
LauncherVersion: launcherVersion,
ClientPlatform: platform()
}
})
.then(res => {
const decrypted = decrypt(res.data)
setLeaderboardData(JSON.parse(decrypted))
})
.catch(e => console.error('Error fetching leaderboard data:', e))
.finally(() => setLoading(false))
const decrypted = await decrypt(response.data)
setLeaderboardData(JSON.parse(decrypted))
} catch (e) {
console.error('Error fetching leaderboard data:', e)
} finally {
setLoading(false)
}
}
function downloadLeaderboard () {