update ui and other frontend updates

This commit is contained in:
JCEEE
2026-07-29 09:41:52 +01:00
parent 04b83925e0
commit 57ef30d3a7
79 changed files with 7323 additions and 429 deletions
@@ -0,0 +1,24 @@
import { fail, redirect } from '@sveltejs/kit';
import { setDeviceTokenCookie } from '$lib/server/auth';
import { SERVER_IP, PROXY_PORT } from '../../../../../../config.ts';
const HONO_URL = `http://${SERVER_IP}:${PROXY_PORT}`;
export const actions = {
default: async (event) => {
const code = event.params.code;
const name = event.params.member;
const res = await fetch(`${HONO_URL}/api/members/direct-join`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ inviteCode: code, name }),
});
const data = await res.json();
if (!res.ok) return fail(400, { error: data.error || 'Join failed' });
setDeviceTokenCookie(event, data.deviceToken);
throw redirect(303, `/${data.famSlug}/${data.name}`);
},
};