diff --git a/docker-compose.yml b/docker-compose.yml
index 68a0602e..38df48cf 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -46,7 +46,7 @@ services:
build: ./web
environment:
<<: *cenv
- MEILI_API_TOKEN:
+ MEILI_API_TOKEN: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcGlLZXlVaWQiOiIwZDA0YTAzYy1iNzBjLTQzZTctOGUzMC00NjNiODFhM2UwY2YiLCJzZWFyY2hSdWxlcyI6eyJ0cmFpbHMiOnsiZmlsdGVyIjoicHVibGljPXRydWUifSwiY2l0aWVzNTAwIjp7fX0sImV4cCI6bnVsbH0.XhHwyRqtKjij2-oPvcYAL3uIFmB4lxUBUgVzhQqL1To
ORIGIN: http://localhost:8080
PUBLIC_POCKETBASE_URL: http://db:8090
ports:
diff --git a/search/bootstrap.py b/search/bootstrap.py
index 3edc95b2..a90f7a55 100644
--- a/search/bootstrap.py
+++ b/search/bootstrap.py
@@ -43,8 +43,8 @@ def init_indices():
def generate_public_token():
- search_key = client.get_keys().results[0]
-
+ search_key = next(filter(lambda r: r.name == "Default Search API Key", client.get_keys().results))
+
search_rules = {
'trails': {
'filter': 'public=true'
@@ -60,6 +60,6 @@ init_indices()
print("Indices initialized!")
token = generate_public_token()
print("Generating public token...")
-print(f"PUBLIC_MEILISEARCH_API_TOKEN:{token}")
+print(f"MEILI_API_TOKEN: {token}")
print("Bootstrapping complete!")
diff --git a/web/src/hooks.server.ts b/web/src/hooks.server.ts
index bcc6303f..c3d5968d 100644
--- a/web/src/hooks.server.ts
+++ b/web/src/hooks.server.ts
@@ -12,7 +12,7 @@ export const handle: Handle = async ({ event, resolve }) => {
// validate the user existence and if the path is acceesible
if (!pb.authStore.model && isRouteProtected(url.pathname)) {
- throw redirect(302, '/login');
+ throw redirect(302, '/login?r='+url.pathname);
} else if (pb.authStore.model && url.pathname === "/login") {
throw redirect(302, '/');
}
diff --git a/web/src/lib/components/empty_states/empty_state_search.svelte b/web/src/lib/components/empty_states/empty_state_search.svelte
index cc8bf4e1..161f8ccd 100644
--- a/web/src/lib/components/empty_states/empty_state_search.svelte
+++ b/web/src/lib/components/empty_states/empty_state_search.svelte
@@ -7,7 +7,7 @@
diff --git a/web/src/lib/components/nav_bar.svelte b/web/src/lib/components/nav_bar.svelte
index 7130ae16..a5c0df6b 100644
--- a/web/src/lib/components/nav_bar.svelte
+++ b/web/src/lib/components/nav_bar.svelte
@@ -78,7 +78,7 @@
function handleDropdownClick(item: { text: string; value: any }) {
if (item.value == "logout") {
logout();
- goto("/");
+ window.location.href = "/";
} else if (item.value == "profile") {
goto("/profile");
}
@@ -117,7 +117,7 @@