Skip to content

Commit

Permalink
return actions setup
Browse files Browse the repository at this point in the history
  • Loading branch information
idan committed Jul 4, 2024
1 parent 407021c commit 2feb53e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/routes/auth/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Actions } from './$types';

export const actions = {
login: async (event) => {
console.error("THE EVENT: ", event, event.request);
return {action: 'login'};
},
logout: async (event) => {
return {action: 'logout'};
},
} satisfies Actions;

7 changes: 7 additions & 0 deletions src/routes/auth/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import type { ActionData } from './$types';
const {form}: {form: ActionData} = $props()
</script>

<div>Form action: {form?.action}</div>
File renamed without changes.

0 comments on commit 2feb53e

Please sign in to comment.