Skip to content

Commit

Permalink
fixed: logout flow & updating settings links
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgobich committed Dec 23, 2024
1 parent f638e5a commit 7f77501
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/controllers/auth/logout_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import User from '#models/user'
import type { HttpContext } from '@adonisjs/core/http'

export default class LogoutController {
async handle({ response, auth, session }: HttpContext) {
async handle({ auth, session, inertia }: HttpContext) {
await User.logout(auth)

session.flash('success', 'See you next time')

return response.redirect().toRoute('auth.login.show')
return inertia.location('https://adocasts.com/signin?action=cms')
}
}
15 changes: 12 additions & 3 deletions inertia/layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ const props = defineProps<{
<DropdownMenuContent align="end">
<DropdownMenuLabel>{{ user.username }}</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem :as="Link" href="/settings/profile">
<DropdownMenuItem as="a" href="https://adocasts.com/settings/account">
Account Settings
</DropdownMenuItem>
<DropdownMenuItem as="a" href="https://adocasts.com/settings/profile">
Profile Settings
</DropdownMenuItem>
<DropdownMenuItem :as="Link" href="/settings/account">
Account Settings
<DropdownMenuItem as="a" href="https://adocasts.com/settings/billing">
Billing Settings
</DropdownMenuItem>
<DropdownMenuItem as="a" href="https://adocasts.com/settings/notifications">
Manage Notification
</DropdownMenuItem>
<DropdownMenuItem as="a" href="https://adocasts.com/settings/data">
Manage Your Data
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem as-child>
Expand Down

0 comments on commit 7f77501

Please sign in to comment.