Read-it-later social network
12
fork

Configure Feed

Select the types of activity you want to include in your feed.

at feat/hide-empty-publications 29 lines 970 B view raw
1import { redirect } from "@sveltejs/kit"; 2import { createQuicksliceClient, QuicksliceClient } from "quickslice-client-js"; 3import type { LayoutLoadEvent } from "./$types"; 4import { resolveHandle, type MiniDoc } from "$lib/utils"; 5 6export const ssr = false; 7 8export const load = async ({ url }: LayoutLoadEvent) => { 9 const atclient = await createQuicksliceClient({ 10 server: "https://admin.potatonet.app", 11 clientId: "client_HYu7ocYtdMWtlOrEhgjpBA" 12 }); 13 14 if (url.searchParams.has("code")) { 15 await atclient.handleRedirectCallback(); 16 redirect(302, "/home"); 17 } 18 19 const isAuthed = await atclient.isAuthenticated(); 20 if (isAuthed) { 21 const user = await atclient.getUser(); 22 if (user) { 23 const info = await resolveHandle(user.did); 24 return { atclient, user: info } as { atclient: QuicksliceClient, user: MiniDoc | undefined } 25 } 26 } 27 28 return { atclient, user: undefined } as { atclient: QuicksliceClient, user: MiniDoc | undefined } 29}