diff --git a/README.md b/README.md index b496c25..9e94d9f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ Attic is a cozy space with lofty ambitions. +What does Attic do? I'm still deciding... it'll probably become a random assortment of features. Right now it has bookmarks. Bookmarks will have search and tags soon. + +Attic is extremely early in development! Use a your own risk :) + * * * Copyright © 2026 [David Bushell](https://dbushell.com) diff --git a/src/lib/server/session.ts b/src/lib/server/session.ts index 7018da0..fb49005 100644 --- a/src/lib/server/session.ts +++ b/src/lib/server/session.ts @@ -40,25 +40,30 @@ export const startSession = async ( handle: string, ): Promise => { if (isHandle(handle) === false) { - throw new Error("invalid handle"); + throw new Error("Invalid handle."); + } + try { + const oAuthClient = createOAuthClient(event); + const { url } = await oAuthClient.authorize({ + target: { "type": "account", identifier: handle }, + }); + // Temporary to remember handle across oauth flow + event.cookies.set( + HANDLE_COOKIE, + handle, + { + httpOnly: true, + maxAge: OAUTH_MAX_AGE, + path: "/", + sameSite: "lax", + secure: !dev, + }, + ); + return url; + } catch (err) { + console.log(err); + throw new Error("OAuth failed."); } - const oAuthClient = createOAuthClient(event); - const { url } = await oAuthClient.authorize({ - target: { "type": "account", identifier: handle }, - }); - // Temporary to remember handle across oauth flow - event.cookies.set( - HANDLE_COOKIE, - handle, - { - httpOnly: true, - maxAge: OAUTH_MAX_AGE, - path: "/", - sameSite: "lax", - secure: !dev, - }, - ); - return url; }; /** diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 3d5fe4d..86d4f7a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,9 +1,15 @@