mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 08:01:35 +00:00
nit redirect on logout
This commit is contained in:
@@ -21,7 +21,7 @@ export async function logout(): Promise<void> {
|
||||
sendUserToast('you have been logged out')
|
||||
}
|
||||
|
||||
async function clearUser() {
|
||||
export async function clearUser() {
|
||||
try {
|
||||
clearStores()
|
||||
await UserService.logout()
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
import CenteredModal from '$lib/components/CenteredModal.svelte'
|
||||
import WindmillIcon from '$lib/components/icons/WindmillIcon.svelte'
|
||||
import { logoutWithRedirect } from '$lib/logout'
|
||||
import { clearUser, logoutWithRedirect } from '$lib/logout'
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
const rd = $page.url.searchParams.get('rd')
|
||||
|
||||
onMount(async () => {
|
||||
await logoutWithRedirect(rd ?? undefined)
|
||||
await clearUser()
|
||||
goto(rd ?? '/user/login')
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user