Skip to content

Cannot log out, as goto() never triggers hooks.server.js #2

Open
@seanodotcom

Description

@seanodotcom

When clicking 'Sign Out', the user's cookie should be deleted, logging them out. However, event.url.searchParams is not updated when using goto() -- it remains an empty object. The URL in the address bar is updated to append ?signout=true, but the cookie remains, and the user can continue to navigate all pages of the site.

NOTE: if the page is refreshed after 'Sign Out', hooks sees the search parameter in the current URL, and event.cookies.delete() runs as expected.

I've tried replacing await goto(`/?signout=${status}`); with throw redirect(303, `/?signout=${status}`);, but that did not resolve the issue.

I also tried to converting handleSignOut() to a synchronous function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions