add agents.md and login and tag bugfix

This commit is contained in:
Garret Patti
2026-07-06 12:48:27 -04:00
parent 6233bbf8d1
commit 6847042664
3 changed files with 73 additions and 3 deletions

View File

@@ -16,7 +16,11 @@
<span class="inline-flex items-center gap-1 bg-gray-700 text-gray-200 text-sm px-3 py-1 rounded-full">
{tag.name}
{#if loggedIn}
<form method="POST" action="?/removeTag" use:enhance class="contents">
<form method="POST" action="?/removeTag" use:enhance={() => {
return async ({ result, update }) => {
if (result.type === 'success') await update();
};
}} class="contents">
<input type="hidden" name="tagId" value={tag.id} />
<button
type="submit"
@@ -31,7 +35,14 @@
{/each}
{#if loggedIn}
<form method="POST" action="?/addTag" use:enhance class="flex items-center gap-1" onsubmit={() => { newTag = ''; }}>
<form method="POST" action="?/addTag" use:enhance={() => {
return async ({ result, update }) => {
if (result.type === 'success') {
newTag = '';
await update();
}
};
}} class="flex items-center gap-1">
<input
type="text"
name="tag"

View File

@@ -3,7 +3,12 @@ import type { Actions } from './$types';
export const actions: Actions = {
default: ({ cookies }) => {
cookies.delete('session', { path: '/' });
cookies.delete('session', {
path: '/',
httpOnly: true,
sameSite: 'strict',
secure: process.env.SECURE_COOKIES === 'true'
});
redirect(303, '/');
}
};