Skip to content

The only tool you need to know what is happening and how to fix it.

feat: clear url after it's loaded

ddux03ac8afc52bd
diff --git a/frontend/src/routes/login/+page.svelte b/frontend/src/routes/login/+page.svelte
index b5121624..cee1e9fa 100644
--- a/frontend/src/routes/login/+page.svelte
+++ b/frontend/src/routes/login/+page.svelte
@@ -14,6 +14,14 @@
let email = $state(page.url.searchParams.get('email') ?? '');
let password = $state(page.url.searchParams.get('password') ?? '');
+
+ if (page.url.searchParams.has('email') || page.url.searchParams.has('password')) {
+ const cleanUrl = new URL(window.location.href);
+ cleanUrl.searchParams.delete('email');
+ cleanUrl.searchParams.delete('password');
+ window.history.replaceState({}, '', cleanUrl.pathname + cleanUrl.search);
+ }
+
let error = $state('');
let loading = $state(false);