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 charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Bolt Launcher</title>
|
<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">
|
<link rel="stylesheet" crossorigin href="/assets/index-DZ9bIuuF.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -52,3 +52,12 @@
|
|||||||
class="ml-2"
|
class="ml-2"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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;
|
flatpak_rich_presence: boolean;
|
||||||
runelite_use_custom_jar: boolean;
|
runelite_use_custom_jar: boolean;
|
||||||
use_custom_rs_config_uri: boolean;
|
use_custom_rs_config_uri: boolean;
|
||||||
|
discard_expired_sessions: boolean;
|
||||||
rs_config_uri?: string;
|
rs_config_uri?: string;
|
||||||
rs_launch_command: string | null;
|
rs_launch_command: string | null;
|
||||||
osrs_launch_command: string | null;
|
osrs_launch_command: string | null;
|
||||||
@@ -40,6 +41,7 @@ export const defaultConfig: Config = {
|
|||||||
flatpak_rich_presence: false,
|
flatpak_rich_presence: false,
|
||||||
runelite_use_custom_jar: false,
|
runelite_use_custom_jar: false,
|
||||||
use_custom_rs_config_uri: false,
|
use_custom_rs_config_uri: false,
|
||||||
|
discard_expired_sessions: true,
|
||||||
rs_launch_command: null,
|
rs_launch_command: null,
|
||||||
osrs_launch_command: null,
|
osrs_launch_command: null,
|
||||||
runelite_custom_jar: null,
|
runelite_custom_jar: null,
|
||||||
@@ -87,6 +89,10 @@ export function initConfig() {
|
|||||||
parsedConfig.close_after_launch = false;
|
parsedConfig.close_after_launch = false;
|
||||||
GlobalState.configHasPendingChanges = true;
|
GlobalState.configHasPendingChanges = true;
|
||||||
}
|
}
|
||||||
|
if (typeof parsedConfig.discard_expired_sessions === 'undefined') {
|
||||||
|
parsedConfig.discard_expired_sessions = true;
|
||||||
|
GlobalState.configHasPendingChanges = true;
|
||||||
|
}
|
||||||
if (isConfigValid(parsedConfig)) {
|
if (isConfigValid(parsedConfig)) {
|
||||||
config.set(parsedConfig);
|
config.set(parsedConfig);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -172,11 +172,13 @@ async function refreshStoredSessions() {
|
|||||||
logger.error(
|
logger.error(
|
||||||
`Unable to verify saved login, status: ${tokensResult.error}. Do you have an internet connection? Please relaunch Bolt to try again.`
|
`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(
|
logger.error(
|
||||||
`Discarding expired login, status: ${tokensResult.error}. Please sign in again.`
|
`Discarding expired login, status: ${tokensResult.error}. Please sign in again.`
|
||||||
);
|
);
|
||||||
expiredTokens.push(session.tokens.sub);
|
expiredTokens.push(session.tokens.sub);
|
||||||
|
} else {
|
||||||
|
logger.error(`Unable to verify saved login due to HTTP error ${tokensResult.error}`);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -191,7 +193,7 @@ async function refreshStoredSessions() {
|
|||||||
const loginResult = await result.promise;
|
const loginResult = await result.promise;
|
||||||
if (!loginResult.ok) {
|
if (!loginResult.ok) {
|
||||||
logger.error(
|
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);
|
expiredTokens.push(session.tokens.sub);
|
||||||
} else {
|
} else {
|
||||||
@@ -199,9 +201,11 @@ async function refreshStoredSessions() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const expiredResults = expiredTokens.map(BoltService.logout);
|
if (expiredTokens.length > 0 && get(GlobalState.config).discard_expired_sessions) {
|
||||||
for (const result of expiredResults) {
|
const expiredResults = expiredTokens.map(BoltService.logout);
|
||||||
await result;
|
for (const result of expiredResults) {
|
||||||
|
await result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalState.sessions.set(sessions);
|
GlobalState.sessions.set(sessions);
|
||||||
|
|||||||
Reference in New Issue
Block a user