mirror of
https://github.com/Adamcake/Bolt.git
synced 2026-04-17 15:56:53 -04:00
File diff suppressed because one or more lines are too long
2
app/dist/index.html
vendored
2
app/dist/index.html
vendored
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Bolt Launcher</title>
|
||||
<script type="module" crossorigin src="/assets/index-Bd1MnOgD.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-DDAv05xa.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DZ9bIuuF.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -52,3 +52,12 @@
|
||||
class="ml-2"
|
||||
/>
|
||||
</div>
|
||||
<div class="mx-auto p-2">
|
||||
<label for="discard_expired_logins">Discard expired login sessions: </label>
|
||||
<input
|
||||
id="discard_expired_logins"
|
||||
type="checkbox"
|
||||
bind:checked={$config.discard_expired_sessions}
|
||||
class="ml-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -15,6 +15,7 @@ export interface Config {
|
||||
flatpak_rich_presence: boolean;
|
||||
runelite_use_custom_jar: boolean;
|
||||
use_custom_rs_config_uri: boolean;
|
||||
discard_expired_sessions: boolean;
|
||||
rs_config_uri?: string;
|
||||
rs_launch_command: string | null;
|
||||
osrs_launch_command: string | null;
|
||||
@@ -40,6 +41,7 @@ export const defaultConfig: Config = {
|
||||
flatpak_rich_presence: false,
|
||||
runelite_use_custom_jar: false,
|
||||
use_custom_rs_config_uri: false,
|
||||
discard_expired_sessions: true,
|
||||
rs_launch_command: null,
|
||||
osrs_launch_command: null,
|
||||
runelite_custom_jar: null,
|
||||
@@ -87,6 +89,10 @@ export function initConfig() {
|
||||
parsedConfig.close_after_launch = false;
|
||||
GlobalState.configHasPendingChanges = true;
|
||||
}
|
||||
if (typeof parsedConfig.discard_expired_sessions === 'undefined') {
|
||||
parsedConfig.discard_expired_sessions = true;
|
||||
GlobalState.configHasPendingChanges = true;
|
||||
}
|
||||
if (isConfigValid(parsedConfig)) {
|
||||
config.set(parsedConfig);
|
||||
} else {
|
||||
|
||||
@@ -172,11 +172,13 @@ async function refreshStoredSessions() {
|
||||
logger.error(
|
||||
`Unable to verify saved login, status: ${tokensResult.error}. Do you have an internet connection? Please relaunch Bolt to try again.`
|
||||
);
|
||||
} else {
|
||||
} else if (tokensResult.error >= 400 && tokensResult.error < 500) {
|
||||
logger.error(
|
||||
`Discarding expired login, status: ${tokensResult.error}. Please sign in again.`
|
||||
);
|
||||
expiredTokens.push(session.tokens.sub);
|
||||
} else {
|
||||
logger.error(`Unable to verify saved login due to HTTP error ${tokensResult.error}`);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -191,7 +193,7 @@ async function refreshStoredSessions() {
|
||||
const loginResult = await result.promise;
|
||||
if (!loginResult.ok) {
|
||||
logger.error(
|
||||
`Unable to sign into saved user '${session.user.displayName}' - please sign in again. ${loginResult.error}`
|
||||
`Unable to sign into saved user '${session.user.displayName}' due to an error: ${loginResult.error}`
|
||||
);
|
||||
expiredTokens.push(session.tokens.sub);
|
||||
} else {
|
||||
@@ -199,9 +201,11 @@ async function refreshStoredSessions() {
|
||||
}
|
||||
}
|
||||
|
||||
const expiredResults = expiredTokens.map(BoltService.logout);
|
||||
for (const result of expiredResults) {
|
||||
await result;
|
||||
if (expiredTokens.length > 0 && get(GlobalState.config).discard_expired_sessions) {
|
||||
const expiredResults = expiredTokens.map(BoltService.logout);
|
||||
for (const result of expiredResults) {
|
||||
await result;
|
||||
}
|
||||
}
|
||||
|
||||
GlobalState.sessions.set(sessions);
|
||||
|
||||
Reference in New Issue
Block a user