add agents.md and login and tag bugfix
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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, '/');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user