v2 #1

Open
kamil wants to merge 231 commits from v2 into main
2 changed files with 12 additions and 6 deletions
Showing only changes of commit c0d33720e9 - Show all commits

View File

@@ -203,10 +203,16 @@
libnovel
</a>
{#if data.user}
<a href="/books" class="text-zinc-400 hover:text-zinc-100 text-sm transition-colors">
<a
href="/books"
class="text-sm transition-colors {page.url.pathname.startsWith('/books') ? 'text-zinc-100 font-medium' : 'text-zinc-400 hover:text-zinc-100'}"
>
Library
</a>
<a href="/browse" class="text-zinc-400 hover:text-zinc-100 text-sm transition-colors">
<a
href="/browse"
class="text-sm transition-colors {page.url.pathname.startsWith('/browse') ? 'text-zinc-100 font-medium' : 'text-zinc-400 hover:text-zinc-100'}"
>
Discover
</a>
<div class="ml-auto flex items-center gap-4">

View File

@@ -8,9 +8,9 @@ const AUTH_COOKIE = 'libnovel_auth';
const ONE_YEAR = 60 * 60 * 24 * 365;
export const load: PageServerLoad = async ({ locals }) => {
// Already logged in — send to library
// Already logged in — send to home
if (locals.user) {
redirect(302, '/books');
redirect(302, '/');
}
return {};
};
@@ -51,7 +51,7 @@ export const actions: Actions = {
maxAge: ONE_YEAR
});
redirect(302, '/books');
redirect(302, '/');
},
register: async ({ request, cookies, locals }) => {
@@ -110,6 +110,6 @@ export const actions: Actions = {
maxAge: ONE_YEAR
});
redirect(302, '/books');
redirect(302, '/');
}
};