Clerk re-render parent server component on sign out with custom sign out button.
Hi I'm probably being a little stupid here but I'm just wondering what the best and most simple way to create a custom sign out button when using Clerk? I was able to create a Sign out button with the following code but the parent server component wouldn't rerender so I needed to refresh for it to show me as logged out:
How can I get the parent server component to re-render on sign out?
Thanks in advance!
3 Replies
https://clerk.com/docs/authentication/sign-out#custom-sign-out this is clerk's documentation on a custom sign out button and that's the exact same code i'm using here so not quite sure what i'm doing wrong
Sign out | Clerk
Detailed documentation about how to sign-out users
just tested this in a "non-app router" app and the component does refresh so this is more of a server component issue rather than a clerk issue
okay i've got it working using
router.refresh()
but i still don't know if this is the right way of doing it incase anyone wants to correct meSolution
just figured out what AfterSignInURL and AfterSignOutURL were 🤦