* feat: add plugin system * fix db docker build * fix hammerhead readme, add strava subscription news to docs * fixes and sdk improvements * fix: reduce Meilisearch load, debounce federation sync (#1012) * optimize meili trail index * several fixes --------- Co-authored-by: Flomp <Flomp@users.noreply.github.com> * Bump svelte from 5.55.5 to 5.56.0 in /docs (#1032) Bumps [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) from 5.55.5 to 5.56.0. - [Release notes](https://github.com/sveltejs/svelte/releases) - [Changelog](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md) - [Commits](https://github.com/sveltejs/svelte/commits/svelte@5.56.0/packages/svelte) --- updated-dependencies: - dependency-name: svelte dependency-version: 5.56.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Flomp <Flomp@users.noreply.github.com> * Release v0.19.2 (#1035) * chore: release v0.19.2 * add changelog --------- Co-authored-by: Flomp <26000991+Flomp@users.noreply.github.com> Co-authored-by: Christian Beutel <> * speed up plugin sync and several small fixes * concepts for security improvements and process stability * improve concept * security concept implemented * remove insecure TLS * worker concept implemented * fixes and cleanup * fixes * docu * mermaid, namings * WASM plugin host improvements, plugin logging * fix db migration * Improve plugin config and category mapping UI * fixes * further fixes * remove manual test sync * fix db migration and strava mapping * type added, UI improvements * fix plugin card toggle clickable area * optimize synch status card layout * plugin type 'trails' instead of 'integration' * session auth validation in UI * fix komoot date and waypoints * improve category mapping * fix send to hammerhead: trail name * plugin setup error handling improved * fix review findings * re-mapping added * rename remote_category --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Flomp <Flomp@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Flomp <26000991+Flomp@users.noreply.github.com>
48 lines
1.5 KiB
Svelte
48 lines
1.5 KiB
Svelte
<script lang="ts">
|
|
import { plugin_oauth_callback } from "$lib/stores/plugin_instance_store";
|
|
import { goto } from "$app/navigation";
|
|
import { page } from "$app/state";
|
|
import { onMount } from "svelte";
|
|
import { _ } from "svelte-i18n";
|
|
|
|
let error = $state("");
|
|
|
|
onMount(async () => {
|
|
const code = page.url.searchParams.get("code") ?? "";
|
|
const state = page.url.searchParams.get("state") ?? "";
|
|
const providerError = page.url.searchParams.get("error");
|
|
const instanceId = sessionStorage.getItem(`wanderer_plugin_oauth_${state}`) ?? "";
|
|
sessionStorage.removeItem(`wanderer_plugin_oauth_${state}`);
|
|
|
|
if (providerError) {
|
|
error = providerError;
|
|
return;
|
|
}
|
|
if (!code || !state || !instanceId) {
|
|
error = "invalid_oauth_callback";
|
|
return;
|
|
}
|
|
|
|
try {
|
|
await plugin_oauth_callback({ instanceId, code, state });
|
|
await goto("/settings/plugins");
|
|
} catch (e) {
|
|
error = e instanceof Error ? e.message : "oauth_error";
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<svelte:head>
|
|
<title>{$_("plugins")} | wanderer</title>
|
|
</svelte:head>
|
|
|
|
<div class="mx-auto max-w-md py-12">
|
|
{#if error}
|
|
<h3 class="text-xl font-semibold">{$_("error")}</h3>
|
|
<p class="mt-3 text-sm text-gray-500">{error}</p>
|
|
<a class="btn-secondary mt-6 inline-block" href="/settings/plugins">{$_("plugins")}</a>
|
|
{:else}
|
|
<h3 class="text-xl font-semibold">{$_("plugins")}</h3>
|
|
{/if}
|
|
</div>
|