mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 16:02:14 +00:00
fix login redirection
This commit is contained in:
@@ -4,6 +4,8 @@ import { clearStores } from './stores.js'
|
||||
import { sendUserToast } from './utils.js'
|
||||
|
||||
export async function logoutWithRedirect(rd?: string): Promise<void> {
|
||||
console.log('logoutWithRedirect', rd)
|
||||
|
||||
await clearUser()
|
||||
if (rd && rd?.split('?')[0] != '/user/login') {
|
||||
const error = document.cookie.includes('token')
|
||||
|
||||
@@ -72,9 +72,7 @@
|
||||
|
||||
<CenteredModal title="Select a workspace" subtitle="Logged in as {$usersWorkspaceStore?.email}">
|
||||
<h2 class="mb-4 inline-flex gap-2"
|
||||
>Workspaces{#if loading}<WindmillIcon
|
||||
class="animate-[pulse_5s_linear_infinite] animate-[spin_5s_linear_infinite]"
|
||||
/>
|
||||
>Workspaces{#if loading}<WindmillIcon class="animate-[spin_5s_linear_infinite]" />
|
||||
{/if}
|
||||
</h2>
|
||||
|
||||
@@ -125,9 +123,7 @@
|
||||
|
||||
<h2 class="mt-6 mb-4">Invites to join a Workspace</h2>
|
||||
{#if invites.length == 0}
|
||||
<p class="text-sm text-gray-500 mt-2">
|
||||
You don't have new invites at the moment.
|
||||
</p>
|
||||
<p class="text-sm text-gray-500 mt-2"> You don't have new invites at the moment. </p>
|
||||
{/if}
|
||||
{#each invites as invite}
|
||||
<div
|
||||
|
||||
@@ -45,7 +45,9 @@
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
await logoutWithRedirect($page.url.pathname + $page.url.search)
|
||||
if ($page.url.pathname != '/user/login') {
|
||||
await logoutWithRedirect($page.url.pathname + $page.url.search)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user