mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-24 15:29:36 +02:00
Update Navbar component and add logout functionality
This commit is contained in:
parent
17e6125998
commit
1b9edeb61f
3 changed files with 4 additions and 2 deletions
1
.env.example
Normal file
1
.env.example
Normal file
|
@ -0,0 +1 @@
|
|||
DATABASE_URL=
|
|
@ -62,8 +62,8 @@
|
|||
{/if}
|
||||
{#if user}
|
||||
<UserAvatar {user} />
|
||||
<form method="post" use:enhance>
|
||||
<button class="btn btn-primary ml-4">Sign out</button>
|
||||
<form method="post" action="/" use:enhance>
|
||||
<button class="btn btn-primary ml-4">Logout</button>
|
||||
</form>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -13,6 +13,7 @@ export const load: PageServerLoad = async (event) => {
|
|||
};
|
||||
};
|
||||
|
||||
// handle the logout action
|
||||
export const actions: Actions = {
|
||||
default: async (event) => {
|
||||
if (!event.locals.session) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue