log out of medusa and reset cart on supabase logout
This commit is contained in:
@@ -127,7 +127,7 @@ export async function login(_currentState: unknown, formData: FormData) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function signout(countryCode: string) {
|
||||
export async function signout(countryCode?: string, shouldRedirect = true) {
|
||||
await sdk.auth.logout()
|
||||
|
||||
await removeAuthToken()
|
||||
@@ -140,7 +140,9 @@ export async function signout(countryCode: string) {
|
||||
const cartCacheTag = await getCacheTag("carts")
|
||||
revalidateTag(cartCacheTag)
|
||||
|
||||
redirect(`/${countryCode}/account`)
|
||||
if (shouldRedirect) {
|
||||
redirect(`/${countryCode!}/account`)
|
||||
}
|
||||
}
|
||||
|
||||
export async function transferCart() {
|
||||
|
||||
Reference in New Issue
Block a user