diff --git a/frontend/src/routes/collections/[id]/+page.svelte b/frontend/src/routes/collections/[id]/+page.svelte index 8de2cb2..91a0939 100644 --- a/frontend/src/routes/collections/[id]/+page.svelte +++ b/frontend/src/routes/collections/[id]/+page.svelte @@ -359,24 +359,28 @@ {/if} -

Linked Adventures

- {#if adventures.length == 0} + + {#if adventures.length == 0 && transportations.length == 0} {/if} -
- {#each adventures as adventure} - - {/each} -
+ {#if adventures.length > 0} +

Linked Adventures

- {#if collection.transportations && collection.transportations.length > 0} +
+ {#each adventures as adventure} + + {/each} +
+ {/if} + + {#if transportations.length > 0}

Transportation

{#each transportations as transportation} diff --git a/frontend/src/routes/settings/forgot-password/confirm/+page.server.ts b/frontend/src/routes/settings/forgot-password/confirm/+page.server.ts new file mode 100644 index 0000000..83c8466 --- /dev/null +++ b/frontend/src/routes/settings/forgot-password/confirm/+page.server.ts @@ -0,0 +1,31 @@ +import { fail, redirect } from '@sveltejs/kit'; +import type { PageServerLoad } from './$types'; +const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL']; +const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000'; + +export const load = (async (event) => { + const token = event.url.searchParams.get('token'); + const uid = event.url.searchParams.get('uid'); + console.log('token', token); + + if (!token) { + return redirect(302, '/settings/forgot-password'); + } else { + let response = await fetch(`${serverEndpoint}/auth/password/reset/confirm/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + token: token, + uid: uid, + new_password1: 'password', + new_password2: 'password' + }) + }); + let data = await response.json(); + console.log('data', data); + } + + return {}; +}) satisfies PageServerLoad; diff --git a/frontend/src/routes/settings/forgot-password/confirm/+page.svelte b/frontend/src/routes/settings/forgot-password/confirm/+page.svelte new file mode 100644 index 0000000..0d9aa7f --- /dev/null +++ b/frontend/src/routes/settings/forgot-password/confirm/+page.svelte @@ -0,0 +1,5 @@ +