Simplify ProfileDropdown logout logic by redirecting to /logout and update nginx.conf to restrict /logout to GET and POST methods only.
This commit is contained in:
@@ -16,8 +16,7 @@ export default function ProfileDropdown() {
|
||||
}, [])
|
||||
|
||||
const handleLogout = async () => {
|
||||
await fetch('/logout', { method: 'POST' })
|
||||
router.push('/')
|
||||
window.location.href = '/logout'
|
||||
}
|
||||
|
||||
const name = profile.email || profile.user || 'Loading...'
|
||||
|
||||
Reference in New Issue
Block a user