Skip to content

Commit

Permalink
#1 Added logout
Browse files Browse the repository at this point in the history
  • Loading branch information
simba77 committed Nov 25, 2023
1 parent 31ef478 commit 7d65fb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/components/PageComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const navigation = [
}
]
const userNavigation = [
{name: 'Sign out', href: '#'},
{name: 'Logout', href: '/api/logout'},
]
</script>

Expand Down
3 changes: 3 additions & 0 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ security:
remember_me: true
check_path: app_auth_login

logout:
path: app_logout

# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall

Expand Down
5 changes: 5 additions & 0 deletions src/Controller/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ public function login(#[CurrentUser] ?User $user): JsonResponse

return $this->json($user, context: ['groups' => 'authUserData']);
}

#[Route('/logout', name: 'app_logout', methods: ['GET'])]
public function logout()
{
}
}

0 comments on commit 7d65fb3

Please sign in to comment.