feat: Improve UI layout and functionality for adventure search

This commit is contained in:
Sean Morley
2024-08-03 20:23:42 -04:00
parent 2bb1d80a77
commit b8994a531f
3 changed files with 55 additions and 15 deletions

View File

@@ -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;

View File

@@ -0,0 +1,5 @@
<script lang="ts">
import type { PageData } from './$types';
export let data: PageData;
</script>